Cleanups
This commit is contained in:
+5
-3
@@ -10,7 +10,7 @@ static inline LPoolBlock *lpool_next(LPool *pool, LPoolBlock *block)
|
||||
if (block->next == NULL_BLOCK) {
|
||||
return NULL;
|
||||
}
|
||||
return (LPoolBlock *)(pool->start + block->next);
|
||||
return (LPoolBlock *)&pool->start[block->next];
|
||||
}
|
||||
|
||||
static inline uint32_t lpool_offset(LPool *pool, LPoolBlock *block)
|
||||
@@ -26,7 +26,7 @@ void lpool_init(LPool *pool, void *buffer, size_t buffer_size, uint32_t block_si
|
||||
assert(align > 0);
|
||||
assert((align & (align - 1)) == 0); // power of 2
|
||||
|
||||
// enforce minimum for storing free list pointers
|
||||
// enforce minimum for storing free list offsets
|
||||
|
||||
if (align < _Alignof(LPoolBlock)) {
|
||||
align = _Alignof(LPoolBlock);
|
||||
@@ -111,7 +111,9 @@ void lpool_free(LPool *pool, void *ptr)
|
||||
|
||||
void lpool_reset(LPool *pool)
|
||||
{
|
||||
if (pool->capacity == 0) return;
|
||||
if (pool->capacity == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
uintptr_t first_addr = (uintptr_t)pool->start;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user