Changeset 35b6eb9
- Timestamp:
- Feb 11, 2011, 4:31:39 PM (14 years ago)
- 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)
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
dict.c
r96828e4 r35b6eb9 96 96 if (d->size + 1 > d->avail) { 97 97 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); 99 99 d->avail = avail; 100 100 if (d->els==NULL) return(-1); -
editwin.c
r96828e4 r35b6eb9 654 654 if (need > 0) { 655 655 size = e->allocated + need + INCR - (need % INCR); 656 e->buff = owl_realloc(e->buff, size);656 e->buff = g_renew(char, e->buff, size); 657 657 e->allocated = size; 658 658 } -
list.c
r96828e4 r35b6eb9 26 26 if ((l->size+n) > l->avail) { 27 27 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); 29 29 if (ptr==NULL) abort(); 30 30 l->list=ptr; -
text.c
r96828e4 r35b6eb9 286 286 if (!strncmp(in+inpos, from, fromlen)) { 287 287 outlen += tolen; 288 out = owl_realloc(out, outlen);288 out = g_renew(char, out, outlen); 289 289 strcpy(out+outpos, to); 290 290 inpos += fromlen; -
util.c
r96828e4 r35b6eb9 304 304 } 305 305 306 void *owl_realloc(void *ptr, size_t size)307 {308 return(g_realloc(ptr, size));309 }310 311 306 /* allocates memory and returns the string or null. 312 307 * caller must free the string. … … 696 691 if ((target + 1) > size) { 697 692 size += BUFSIZ; 698 *s = owl_realloc(*s, size);693 *s = g_renew(char, *s, size); 699 694 } 700 695 if (c == EOF) … … 713 708 /* Read a line from fp, allocating memory to hold it, returning the number of 714 709 * 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 must710 * g_malloc; it will be g_renew'd as appropriate. The caller must 716 711 * eventually free it. (This is roughly the interface of getline in the gnu 717 712 * libc). … … 739 734 740 735 while (1) { 741 buf = owl_realloc(buf, size + BUFSIZ);736 buf = g_renew(char, buf, size + BUFSIZ); 742 737 p = &buf[size]; 743 738 size += BUFSIZ; -
zephyr.c
r96828e4 r35b6eb9 286 286 if (count >= subSize) { 287 287 subSize *= 2; 288 subs = owl_realloc(subs, sizeof(ZSubscription_t) *subSize);288 subs = g_renew(ZSubscription_t, subs, subSize); 289 289 } 290 290 … … 397 397 if (count == numSubs) { 398 398 numSubs *= 2; 399 subs = owl_realloc(subs, numSubs * sizeof(ZSubscription_t));399 subs = g_renew(ZSubscription_t, subs, numSubs); 400 400 } 401 401
Note: See TracChangeset
for help on using the changeset viewer.