slab: fix large slab deallocation

This commit is contained in:
Matheus
2023-05-07 21:23:22 -03:00
parent 94057abfaf
commit 24091f6e3f
+2 -2
View File
@@ -95,8 +95,8 @@ static slab_t *returnobject(scache_t *cache, void *obj) {
freeptr = (void **)((uintptr_t)obj + cache->size);
__assert(*freeptr == NULL);
} else {
slab = cache->full;
bool partial = false;
bool partial = cache->full == NULL;
slab = partial ? cache->partial : cache->full;
while (slab) {
void *top = (void *)((uintptr_t)slab->base + cache->slabobjcount * cache->truesize);
if (obj >= slab->base && obj < top)