Changeset 35b6eb9 for util.c


Ignore:
Timestamp:
Feb 11, 2011, 4:31:39 PM (13 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.10, release-1.8, release-1.9
Children:
ddbbcffa
Parents:
96828e4
git-author:
Anders Kaseorg <andersk@mit.edu> (08/27/09 00:52:03)
git-committer:
Anders Kaseorg <andersk@mit.edu> (02/11/11 16:31:39)
Message:
Replace owl_realloc with g_renew.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Karl Ramm <kcr@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • util.c

    r96828e4 r35b6eb9  
    304304}
    305305
    306 void *owl_realloc(void *ptr, size_t size)
    307 {
    308   return(g_realloc(ptr, size));
    309 }
    310 
    311306/* allocates memory and returns the string or null.
    312307 * caller must free the string.
     
    696691    if ((target + 1) > size) {
    697692      size += BUFSIZ;
    698       *s = owl_realloc(*s, size);
     693      *s = g_renew(char, *s, size);
    699694    }
    700695    if (c == EOF)
     
    713708/* Read a line from fp, allocating memory to hold it, returning the number of
    714709 * byte read.  *s should either be NULL or a pointer to memory allocated with
    715  * g_malloc; it will be owl_realloc'd as appropriate.  The caller must
     710 * g_malloc; it will be g_renew'd as appropriate.  The caller must
    716711 * eventually free it.  (This is roughly the interface of getline in the gnu
    717712 * libc).
     
    739734
    740735  while (1) {
    741     buf = owl_realloc(buf, size + BUFSIZ);
     736    buf = g_renew(char, buf, size + BUFSIZ);
    742737    p = &buf[size];
    743738    size += BUFSIZ;
Note: See TracChangeset for help on using the changeset viewer.