aboutsummaryrefslogtreecommitdiff
path: root/tests/allocs.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 /tests/allocs.c
parenta4d37d76512c293b12aab1f77961f96d572557b7 (diff)
downloadungrateful-471b539bdbf658ff7924b7500f89fd237df8be9b.tar.gz
ungrateful-471b539bdbf658ff7924b7500f89fd237df8be9b.zip
Reordering of stuff + plans
Diffstat (limited to 'tests/allocs.c')
-rw-r--r--tests/allocs.c39
1 files changed, 0 insertions, 39 deletions
diff --git a/tests/allocs.c b/tests/allocs.c
deleted file mode 100644
index 608d9f4..0000000
--- a/tests/allocs.c
+++ /dev/null
@@ -1,39 +0,0 @@
-#include <ungrateful.h>
-
-int main(void) {
- u64 i, size, *value;
- size = UN_KB(1);
-
- { // std
- Allocator std = un_allocator_get_standard();
- void *mem = un_memory_alloc(size, std);
-
- if (mem != NULL) {
- un_memory_free(mem, std);
- }
- }
-
- { // temp
- Allocator temp = un_allocator_get_temporary();
-
- u8 *mem = (u8*) un_memory_alloc(size, temp);
- assert(mem != NULL);
-
- for (i = 0; i < size; i++) {
- mem[i] = 0xAB;
- }
-
- un_memory_destroy(&temp);
- }
-
- { // arena
- Allocator arena = un_allocator_create_arena(size);
-
- for (i = 0; i < 1000; i++) {
- value = un_memory_alloc(8, arena);
- *value = 0xAC;
- }
-
- un_memory_destroy(&arena);
- }
-}