| 63 | long *nhrealloc(long *, unsigned int, const char *, int) NONNULL; |
| 64 | #endif |
| 65 | ATTRNORETURN extern void panic(const char *, ...) PRINTF_F(1, 2) NORETURN; |
| 66 | |
| 67 | long * |
| 68 | alloc(unsigned int lth) |
| 69 | { |
| 70 | genericptr_t ptr; |
| 71 | |
| 72 | ForceAlignedLength(lth); |
| 73 | ptr = malloc(lth); |
| 74 | #ifndef MONITOR_HEAP |
| 75 | if (!ptr) |
| 76 | panic("Memory allocation failure; cannot get %u bytes", lth); |
| 77 | #else |
| 78 | /* for #if MONITOR_HEAP, failure is handled in nhalloc() */ |
| 79 | #endif |
| 80 | return (long *) ptr; |
| 81 | } |
| 82 | |
| 83 | /* realloc() call that might get substituted by nhrealloc(p,n,file,line) */ |
| 84 | long * |
no test coverage detected