| 149 | } |
| 150 | |
| 151 | long * |
| 152 | nhalloc(unsigned int lth, const char *file, int line) |
| 153 | { |
| 154 | long *ptr = alloc(lth); |
| 155 | |
| 156 | if (!tried_heaplog) |
| 157 | heapmon_init(); |
| 158 | if (heaplog) |
| 159 | (void) fprintf(heaplog, "+%5u %s %4d %s\n", lth, |
| 160 | fmt_ptr((genericptr_t) ptr), line, file); |
| 161 | /* potential panic in alloc() was deferred til here */ |
| 162 | if (!ptr) |
| 163 | panic("Cannot get %u bytes, line %d of %s", lth, line, file); |
| 164 | |
| 165 | return ptr; |
| 166 | } |
| 167 | |
| 168 | /* re_alloc() with heap logging; we lack access to the old alloc size */ |
| 169 | long * |