228,6 → 228,8 |
static count_t slab_obj_destroy(slab_cache_t *cache, void *obj, |
slab_t *slab) |
{ |
count_t frames = 0; |
|
if (!slab) |
slab = obj2slab(obj); |
|
244,17 → 246,19 |
if (slab->available == cache->objects) { |
/* Free associated memory */ |
list_remove(&slab->link); |
spinlock_unlock(&cache->slablock); |
|
return slab_space_free(cache, slab); |
|
/* This should not produce deadlock, as |
* magazine is always allocated with NO reclaim, |
* keep all locks */ |
frames = slab_space_free(cache, slab); |
} else if (slab->available == 1) { |
/* It was in full, move to partial */ |
list_remove(&slab->link); |
list_prepend(&slab->link, &cache->partial_slabs); |
spinlock_unlock(&cache->slablock); |
} |
return 0; |
|
spinlock_unlock(&cache->slablock); |
|
return frames; |
} |
|
/** |
740,6 → 744,7 |
|
/* TODO: Add assert, that interrupts are disabled, otherwise |
* memory allocation from interrupts can deadlock. |
* - cache_destroy can call this with interrupts enabled :-/ |
*/ |
|
for (cur = slab_cache_list.next;cur!=&slab_cache_list; cur=cur->next) { |