mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-02 07:28:21 +00:00
slab: fix large slab deallocation
This commit is contained in:
@@ -95,8 +95,8 @@ static slab_t *returnobject(scache_t *cache, void *obj) {
|
|||||||
freeptr = (void **)((uintptr_t)obj + cache->size);
|
freeptr = (void **)((uintptr_t)obj + cache->size);
|
||||||
__assert(*freeptr == NULL);
|
__assert(*freeptr == NULL);
|
||||||
} else {
|
} else {
|
||||||
slab = cache->full;
|
bool partial = cache->full == NULL;
|
||||||
bool partial = false;
|
slab = partial ? cache->partial : cache->full;
|
||||||
while (slab) {
|
while (slab) {
|
||||||
void *top = (void *)((uintptr_t)slab->base + cache->slabobjcount * cache->truesize);
|
void *top = (void *)((uintptr_t)slab->base + cache->slabobjcount * cache->truesize);
|
||||||
if (obj >= slab->base && obj < top)
|
if (obj >= slab->base && obj < top)
|
||||||
|
|||||||
Reference in New Issue
Block a user