Cleanups
This commit is contained in:
+1
-1
@@ -7,7 +7,7 @@
|
||||
void debug_alloc(const LAlloc *allocator)
|
||||
{
|
||||
puts("--debug start--");
|
||||
for (LBlockHeader *b = allocator->heap_start; b; b = lblock_from_offset(allocator, b->next)) {
|
||||
for (LBlockHeader *b = (LBlockHeader *)allocator->base; b; b = lblock_from_offset(allocator, b->next)) {
|
||||
printf("Block size %u free %d prev %u next %u \n", lblock_size(b), lblock_is_free(b), b->prev, b->next);
|
||||
}
|
||||
puts("--debug end--");
|
||||
|
||||
+2
-3
@@ -12,8 +12,8 @@ struct TestData {
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
//_Alignas(16) uint8_t store[2048];
|
||||
uint8_t *store = malloc(2048);
|
||||
_Alignas(16) uint8_t store[2048];
|
||||
// uint8_t *store = malloc(1024 * 1024 - 17);
|
||||
|
||||
LPool pool;
|
||||
lpool_init(&pool, store, 2048, sizeof(struct TestData), _Alignof(struct TestData));
|
||||
@@ -42,6 +42,5 @@ int main(int argc, char *argv[])
|
||||
allocs++;
|
||||
}
|
||||
printf("Total allocs = %zu, used = %u\n", allocs, pool.used);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user