comparison src/alloc.c @ 551:e9a3f8b4de53

[xemacs-hg @ 2001-05-21 05:26:06 by martinb] realloc() handling on sunos4; remove lwlib-config kludge
author martinb
date Mon, 21 May 2001 05:26:51 +0000
parents 223736d75acb
children 183866b06e0b
comparison
equal deleted inserted replaced
550:1638aacf421d 551:e9a3f8b4de53
269 269
270 #undef xrealloc 270 #undef xrealloc
271 void * 271 void *
272 xrealloc (void *block, size_t size) 272 xrealloc (void *block, size_t size)
273 { 273 {
274 /* We must call malloc explicitly when BLOCK is 0, since some 274 block = realloc (block, size);
275 reallocs don't do this. */ 275
276 void *val = block ? realloc (block, size) : malloc (size); 276 if (!block && (size != 0)) memory_full ();
277 277 return block;
278 if (!val && (size != 0)) memory_full ();
279 return val;
280 } 278 }
281 279
282 void 280 void
283 #ifdef ERROR_CHECK_MALLOC 281 #ifdef ERROR_CHECK_MALLOC
284 xfree_1 (void *block) 282 xfree_1 (void *block)