From 685844c5940dab356c348c51ceee29954305ec8b Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 6 Apr 2015 20:01:14 -0400 Subject: Fixed initial Mac OS X code. --- new/alloc_darwin.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'new/alloc_darwin.m') 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; } -- cgit v1.2.3