diff options
Diffstat (limited to 'new/alloc_windows.c')
| -rw-r--r-- | new/alloc_windows.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/new/alloc_windows.c b/new/alloc_windows.c index 55ebea7..9c7900f 100644 --- a/new/alloc_windows.c +++ b/new/alloc_windows.c @@ -15,9 +15,8 @@ void *uiAlloc(size_t size, const char *type) if (out == NULL) abort(); // TODO figure this part out ZeroMemory(out, size); -#ifdef uiLogAllocations - fprintf(stderr, "%p alloc %s\n", out, type); -#endif + if (options.debugLogAllocations) + fprintf(stderr, "%p alloc %s\n", out, type); return out; } @@ -31,9 +30,8 @@ void *uiRealloc(void *p, size_t size, const char *type) if (out == NULL) abort(); // TODO zero the extra memory -#ifdef uiLogAllocations - fprintf(stderr, "%p realloc %p\n", p, out); -#endif + if (options.debugLogAllocations) + fprintf(stderr, "%p realloc %p\n", p, out); return out; } @@ -42,7 +40,6 @@ void uiFree(void *p) if (p == NULL) return; free(p); -#ifdef uiLogAllocations - fprintf(stderr, "%p free\n", p); -#endif + if (options.debugLogAllocations) + fprintf(stderr, "%p free\n", p); } |
