Doubles the allocated size associated to a pointer 'size' is the current allocated size. */
| 216 | 'size' is the current allocated size. |
| 217 | */ |
| 218 | static void * mem_double(void * ptr, int size) |
| 219 | { |
| 220 | void *newptr; |
| 221 | |
| 222 | newptr = calloc(2*size, 1); |
| 223 | memcpy(newptr, ptr, size); |
| 224 | free(ptr); |
| 225 | return newptr ; |
| 226 | } |
| 227 | |
| 228 | |
| 229 | /*--------------------------------------------------------------------------- |