Changeset 35b6eb9


Ignore:
Timestamp:
Feb 11, 2011, 4:31:39 PM (10 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, 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>
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • dict.c

    r96828e4 r35b6eb9  
    9696    if (d->size + 1 > d->avail) {
    9797      int avail = MAX(d->avail * GROWBY, d->size + 1);
    98       d->els = owl_realloc(d->els, avail * sizeof(owl_dict_el));
     98      d->els = g_renew(owl_dict_el, d->els, avail);
    9999      d->avail = avail;
    100100      if (d->els==NULL) return(-1);
  • editwin.c

    r96828e4 r35b6eb9  
    654654  if (need > 0) {
    655655    size = e->allocated + need + INCR - (need % INCR);
    656     e->buff = owl_realloc(e->buff, size);
     656    e->buff = g_renew(char, e->buff, size);
    657657    e->allocated = size;
    658658  }
  • list.c

    r96828e4 r35b6eb9  
    2626  if ((l->size+n) > l->avail) {
    2727    int avail = MAX(l->avail * GROWBY, l->size + n);
    28     ptr = owl_realloc(l->list, avail * sizeof(void *));
     28    ptr = g_renew(void *, l->list, avail);
    2929    if (ptr==NULL) abort();
    3030    l->list=ptr;
  • text.c

    r96828e4 r35b6eb9  
    286286    if (!strncmp(in+inpos, from, fromlen)) {
    287287      outlen += tolen;
    288       out = owl_realloc(out, outlen);
     288      out = g_renew(char, out, outlen);
    289289      strcpy(out+outpos, to);
    290290      inpos += fromlen;
  • 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;
  • zephyr.c

    r96828e4 r35b6eb9  
    286286    if (count >= subSize) {
    287287      subSize *= 2;
    288       subs = owl_realloc(subs, sizeof(ZSubscription_t) * subSize);
     288      subs = g_renew(ZSubscription_t, subs, subSize);
    289289    }
    290290   
     
    397397      if (count == numSubs) {
    398398        numSubs *= 2;
    399         subs = owl_realloc(subs, numSubs * sizeof(ZSubscription_t));
     399        subs = g_renew(ZSubscription_t, subs, numSubs);
    400400      }
    401401
Note: See TracChangeset for help on using the changeset viewer.