Skip to content
This repository was archived by the owner on Apr 15, 2026. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/alloc_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,11 @@ static inline qd_alloc_item_t *pop_stack(qd_alloc_linked_stack_t *const stack)
}
prev_chunk_stack(stack);
}
assert(stack->top > 0);
stack->top--;
assert(stack->top >= 0 && stack->top < CHUNK_SIZE);
assert(stack->top < CHUNK_SIZE);
assert(stack->size > 0);
stack->size--;
assert(stack->size >= 0);
qd_alloc_item_t *item = stack->top_chunk->items[stack->top];
assert(item != NULL);
return item;
Expand Down Expand Up @@ -153,6 +154,7 @@ static inline bool push_stack(qd_alloc_linked_stack_t *stack, qd_alloc_item_t *i
return false;
}
}
assert(stack->top < chunk_size);
stack->size++;
stack->top_chunk->items[stack->top] = item;
stack->top++;
Expand Down