diff options
| author | Pietro Gagliardi <[email protected]> | 2015-04-06 20:01:14 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2015-04-06 20:01:14 -0400 |
| commit | 685844c5940dab356c348c51ceee29954305ec8b (patch) | |
| tree | 8516bcb1633a22a3f041af2d2df0a2115a2b5328 /new/alloc_darwin.m | |
| parent | e4d6d11925e7da8eb8b6c2960ddff88245b876ff (diff) | |
Fixed initial Mac OS X code.
Diffstat (limited to 'new/alloc_darwin.m')
| -rw-r--r-- | new/alloc_darwin.m | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/new/alloc_darwin.m b/new/alloc_darwin.m index 48b2a12..059152a 100644 --- a/new/alloc_darwin.m +++ b/new/alloc_darwin.m @@ -1,12 +1,14 @@ // 4 december 2014 #include "ui_darwin.h" +// TODO is there a better alternative to NSCAssert()? preferably a built-in allocator that panics on out of memory for us? + void *uiAlloc(size_t size) { void *out; out = malloc(size); - NSAssert(out != NULL, @"out of memory in uiAlloc()"); + NSCAssert(out != NULL, @"out of memory in uiAlloc()"); memset(out, 0, size); return out; } @@ -18,7 +20,7 @@ void *uiRealloc(void *p, size_t size) if (p == NULL) return uiAlloc(size); out = realloc(p, size); - NSAssert(out != NULL, @"out of memory in uiRealloc()"); + NSCAssert(out != NULL, @"out of memory in uiRealloc()"); // TODO zero the extra memory return out; } |
