diff options
Diffstat (limited to 'src/un_memory.c')
-rw-r--r-- | src/un_memory.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/un_memory.c b/src/un_memory.c index 9ff316b..84f5f14 100644 --- a/src/un_memory.c +++ b/src/un_memory.c @@ -111,12 +111,12 @@ static void temp_reset(void) { static void *temp_alloc(u64 size) { if ((temp.index + size) > UN_TEMP_SIZE) { - un_log_write_cstring(UN_LOG_ERROR, UN_CSTR "Temp allocator wrapped!"); + // @todo: Decice what is the best behaviour for wrapping + assert(false); temp_reset(); } if ((temp.index + size) > UN_TEMP_SIZE) { - un_log_write_cstring(UN_LOG_ERROR, UN_CSTR "Too much space requested!"); return NULL; } @@ -164,7 +164,6 @@ static Arena *arena_create(u64 size) { arena = CLITERAL(Arena*)un_memory_alloc(size, alloc); if (!arena) { - un_log_write_cstring(UN_LOG_FATAL, UN_CSTR "Buy mem, failed to create arena!"); return NULL; } @@ -206,10 +205,8 @@ static ALLOCATOR_PROC_SIGNATURE(un_arena_alloc_proc) { case UN_ALLOC_MSG_ALLOCATE: return arena_allocate(size, (Arena*)data); case UN_ALLOC_MSG_REALLOCATE: - un_log_write_cstring(UN_LOG_ERROR, UN_CSTR "Arena doesn't reallocate."); break; case UN_ALLOC_MSG_FREE: - un_log_write_cstring(UN_LOG_ERROR, UN_CSTR "Arena doesn't free it's memory, please destroy arena itself."); break; case UN_ALLOC_MSG_SELF_DELETE: arena_delete((Arena*)data); |