If ${NH_HEAPLOG} is defined and we can create a file by that name, then we'll log the allocation and release information to that file. */
| 139 | /* If ${NH_HEAPLOG} is defined and we can create a file by that name, |
| 140 | then we'll log the allocation and release information to that file. */ |
| 141 | staticfn void |
| 142 | heapmon_init(void) |
| 143 | { |
| 144 | char *logname = getenv("NH_HEAPLOG"); |
| 145 | |
| 146 | if (logname && *logname) |
| 147 | heaplog = fopen(logname, "w"); |
| 148 | tried_heaplog = TRUE; |
| 149 | } |
| 150 | |
| 151 | long * |
| 152 | nhalloc(unsigned int lth, const char *file, int line) |