summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorOmniscient <17525998+omnisci3nce@users.noreply.github.com>2024-02-25 17:36:36 +1100
committerOmniscient <17525998+omnisci3nce@users.noreply.github.com>2024-02-25 17:36:36 +1100
commit06ed6edcedf30fd8f7e036fffe8f81e8ca89d4b0 (patch)
treef5ae75e431817a53ee5725b4c0d6f3e61b15a664 /tests
parent109b6dd1881d90915e972f0d263a032bd262adb5 (diff)
parentb5b7cea24c46d28a4b72bc18ca8ccb2d532007d3 (diff)
Merge branch 'master' of github.com:omnisci3nce/celeritas-core
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