move std allocator to forever allocator

This commit is contained in:
2025-12-06 14:20:50 +01:00
parent d6ad1c7602
commit 8f47d7db2b
+12
View File
@@ -0,0 +1,12 @@
#include <criterion/criterion.h>
#include "cig.h"
Test(forever_allocator, test) {
allocator_t this = forever_allocator();
void *ptr = allocator_alloc(this, 10);
cr_assert(ptr != ((void *)0), "non null from malloc");
void *new_ptr = allocator_resize(this, ptr, 1024*1024*500);
cr_assert(new_ptr != ((void *)0), "non null from realloc");
cr_assert(new_ptr != ptr, "realloc is not the same ptr as malloc");
free(new_ptr);
}