summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoshua Rowe <17525998+omnisci3nce@users.noreply.github.com>2024-02-25 13:49:24 +1100
committerGitHub <noreply@github.com>2024-02-25 13:49:24 +1100
commitfc287c6e4f958242a4272da5cb1704e3e789fe07 (patch)
tree47c8d1fdf271c41f930aaa5d0373a834b1c9e665 /tests
parent64f23d9726c55d5c965f123ffc5b6ca47ec1f475 (diff)
parenta1c3e27c53558fde411e63d8b3e3809c79789ea4 (diff)
Merge pull request #1 from omnisci3nce/cel-18-arena-allocator
CEL-18 arena allocator
Diffstat (limited to 'tests')
-rw-r--r--tests/arena_tests.c12
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