diff --git a/README.md b/README.md index 3895ad0..208e82c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +# ISSUES +No matter what I do it says that there are 2666 allocations or something. This +is concerning. + # A collection of libraries inspired by zig I like zig, but I really like writing C. I am starting with implementing diff --git a/test_borrow_allocator.c b/test_borrow_allocator.c index ed97ace..9d6f24b 100644 --- a/test_borrow_allocator.c +++ b/test_borrow_allocator.c @@ -13,14 +13,15 @@ Test(borrow_allocator, test) { borrow_allocator_assert_all_freed(&balloc); } - -// TODO: when I update the number of allocations it does not seem to change the -// number of allocated bytes... +#define IS_SIZE 900 Test(borrow_allocator, with) { with_borrow(foo) { - allocator_alloc(foo, 1000); - allocator_alloc(foo, 100); - allocator_alloc(foo, 90); + int *is = allocator_alloc(foo, sizeof(int) * IS_SIZE); + for (int i = 0; i < IS_SIZE; i++) is[i] = i; + is = allocator_alloc(foo, sizeof(int) * IS_SIZE); + for (int i = 0; i < IS_SIZE; i++) is[i] = i; + is = allocator_alloc(foo, sizeof(int) * IS_SIZE); + for (int i = 0; i < IS_SIZE; i++) is[i] = i; break; } }