realloc() call that might get substituted by nhrealloc(p,n,file,line) */
| 82 | |
| 83 | /* realloc() call that might get substituted by nhrealloc(p,n,file,line) */ |
| 84 | long * |
| 85 | re_alloc(long *oldptr, unsigned int newlth) |
| 86 | { |
| 87 | long *newptr; |
| 88 | |
| 89 | ForceAlignedLength(newlth); |
| 90 | newptr = (long *) realloc((genericptr_t) oldptr, (size_t) newlth); |
| 91 | #ifndef MONITOR_HEAP |
| 92 | /* "extend to": assume it won't ever fail if asked to shrink */ |
| 93 | if (newlth && !newptr) |
| 94 | panic("Memory allocation failure; cannot extend to %u bytes", newlth); |
| 95 | #else |
| 96 | /* for #if MONITOR_HEAP, failure is handled in nhrealloc() */ |
| 97 | #endif |
| 98 | return newptr; |
| 99 | } |
| 100 | |
| 101 | #ifdef HAS_PTR_FMT |
| 102 | #define PTR_FMT "%p" |