blob: 88fc21b520f5476a59658e0f2886d398fc941f28 (
plain)
1
2
3
4
5
6
7
8
9
10
11
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
*/
|