summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index f3ca77e..d76e20d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -7,8 +7,28 @@
7#include <error.h> 7#include <error.h>
8#include <stdio.h> 8#include <stdio.h>
9 9
10#include <string.h>
11#include <stdlib.h>
10int main() { 12int main() {
11 error(1, ENOTSUP, "No main file lol"); 13 // error(1, ENOTSUP, "No main file lol");
14
15 // Testing Arena changes
16 const int DATA[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
17
18 arena *arena = arena_init(sizeof(DATA));
19 if(!arena)
20 error(1, errno, "Could not initialize arena");
21
22 int *nums = arena_alloc(arena, sizeof(DATA));
23 if(!nums)
24 error(1, errno, "Could not allocate memory");
25
26 memmove(nums, DATA, sizeof(DATA));
27 for(unsigned int i = 0; i < STATIC_ARRAY_LEN(DATA); i++)
28 printf("%d ", nums[i]);
29 printf("\n");
30
31 arena_free(&arena);
12 32
13 return 0; 33 return 0;
14} \ No newline at end of file 34} \ No newline at end of file