aboutsummaryrefslogtreecommitdiff
path: root/src/un_memory.c
diff options
context:
space:
mode:
authorbonmas14 <bonmas14@gmail.com>2025-08-03 19:24:03 +0000
committerbonmas14 <bonmas14@gmail.com>2025-08-03 19:24:03 +0000
commit471b539bdbf658ff7924b7500f89fd237df8be9b (patch)
treea6a0b1d8a7a37ebe288cd7e1accf9b16dee203aa /src/un_memory.c
parenta4d37d76512c293b12aab1f77961f96d572557b7 (diff)
downloadungrateful-471b539bdbf658ff7924b7500f89fd237df8be9b.tar.gz
ungrateful-471b539bdbf658ff7924b7500f89fd237df8be9b.zip
Reordering of stuff + plans
Diffstat (limited to 'src/un_memory.c')
-rw-r--r--src/un_memory.c7
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);