alloc: fix free in full slab
This commit is contained in:
parent
0c389afa8f
commit
b2d3cd62ca
@ -192,7 +192,11 @@ int freeFromSlab(void *ptr, struct slabEntry *slab)
|
|||||||
if ((slabEntry->page <= (vaddr_t)ptr) &&
|
if ((slabEntry->page <= (vaddr_t)ptr) &&
|
||||||
((vaddr_t)ptr < (slabEntry->page + PAGE_SIZE))) {
|
((vaddr_t)ptr < (slabEntry->page + PAGE_SIZE))) {
|
||||||
// pr_devel("free place! was %d is now %d\n", slabEntry->freeEl, ptr);
|
// pr_devel("free place! was %d is now %d\n", slabEntry->freeEl, ptr);
|
||||||
*((vaddr_t *)ptr) = (vaddr_t)slabEntry->freeEl;
|
if (slabEntry->full) {
|
||||||
|
*((vaddr_t *)ptr) = (vaddr_t)NULL;
|
||||||
|
} else {
|
||||||
|
*((vaddr_t *)ptr) = (vaddr_t)slabEntry->freeEl;
|
||||||
|
}
|
||||||
slabEntry->freeEl = ptr;
|
slabEntry->freeEl = ptr;
|
||||||
slabEntry->full = 0;
|
slabEntry->full = 0;
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user