diff options
| author | Pietro Gagliardi <[email protected]> | 2015-04-10 18:06:01 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2015-04-10 18:06:01 -0400 |
| commit | d5da551c8ca58df3b76d4985417ba1a8bcbd886e (patch) | |
| tree | afcd4eea27cabce206d057bc59603761c4340c48 /new/alloc_windows.c | |
| parent | a788c1b2127b7c9d4eae1cef175f0f43b29b9711 (diff) | |
More TODO resolution.
Diffstat (limited to 'new/alloc_windows.c')
| -rw-r--r-- | new/alloc_windows.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/new/alloc_windows.c b/new/alloc_windows.c index 9c7900f..147c90d 100644 --- a/new/alloc_windows.c +++ b/new/alloc_windows.c @@ -12,8 +12,10 @@ void *uiAlloc(size_t size, const char *type) void *out; out = malloc(size); - if (out == NULL) - abort(); // TODO figure this part out + if (out == NULL) { + fprintf(stderr, "memory exhausted in uiAlloc() allocating %s\n", type); + abort(); + } ZeroMemory(out, size); if (options.debugLogAllocations) fprintf(stderr, "%p alloc %s\n", out, type); @@ -27,8 +29,10 @@ void *uiRealloc(void *p, size_t size, const char *type) if (p == NULL) return uiAlloc(size, type); out = realloc(p, size); - if (out == NULL) + if (out == NULL) { + fprintf(stderr, "memory exhausted in uiRealloc() reallocating %s\n", type); abort(); + } // TODO zero the extra memory if (options.debugLogAllocations) fprintf(stderr, "%p realloc %p\n", p, out); |
