- 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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;
Note: See TracChangeset
for help on using the changeset viewer.