minor changes to tests

This commit is contained in:
2025-10-10 20:31:20 +02:00
parent c5d6d2ff08
commit 86d5110b0b
2 changed files with 11 additions and 6 deletions
+4
View File
@@ -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 # A collection of libraries inspired by zig
I like zig, but I really like writing C. I am starting with implementing I like zig, but I really like writing C. I am starting with implementing
+7 -6
View File
@@ -13,14 +13,15 @@ Test(borrow_allocator, test) {
borrow_allocator_assert_all_freed(&balloc); borrow_allocator_assert_all_freed(&balloc);
} }
#define IS_SIZE 900
// TODO: when I update the number of allocations it does not seem to change the
// number of allocated bytes...
Test(borrow_allocator, with) { Test(borrow_allocator, with) {
with_borrow(foo) { with_borrow(foo) {
allocator_alloc(foo, 1000); int *is = allocator_alloc(foo, sizeof(int) * IS_SIZE);
allocator_alloc(foo, 100); for (int i = 0; i < IS_SIZE; i++) is[i] = i;
allocator_alloc(foo, 90); 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; break;
} }
} }