diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/arena_tests.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/arena_tests.c b/tests/arena_tests.c new file mode 100644 index 0000000..88fc21b --- /dev/null +++ b/tests/arena_tests.c @@ -0,0 +1,12 @@ +/* +size_t arena_size = 16; + arena scratch = arena_create(malloc(arena_size), arena_size); + + i32* int_ptr = arena_alloc(&scratch, sizeof(i32)); + i32* b = arena_alloc(&scratch, sizeof(i32)); + i32* c = arena_alloc(&scratch, sizeof(i32)); + *int_ptr = 55; + printf("Int pointer %d %p\n", (*int_ptr), int_ptr); + + // will abort on second arena alloc +*/
\ No newline at end of file |