summaryrefslogtreecommitdiff
path: root/new/alloc_darwin.m
diff options
context:
space:
mode:
Diffstat (limited to 'new/alloc_darwin.m')
-rw-r--r--new/alloc_darwin.m6
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;
}