mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 15:08:21 +00:00
slab: fix some issues
This commit is contained in:
@@ -66,7 +66,7 @@ static inline bool grow_cache(scache_t *cache) {
|
|||||||
|
|
||||||
if (unlikely(i < SLAB_INDIRECT_COUNT)) {
|
if (unlikely(i < SLAB_INDIRECT_COUNT)) {
|
||||||
for (int j = 0; j < i; ++j)
|
for (int j = 0; j < i; ++j)
|
||||||
slab_free(indirect_cache, indirect[i]);
|
slab_free(indirect_cache, indirect[j]);
|
||||||
|
|
||||||
vmm_unmap(slab->base, byte_size, 0);
|
vmm_unmap(slab->base, byte_size, 0);
|
||||||
|
|
||||||
@@ -230,7 +230,7 @@ static void free_to_slab(scache_t *cache, void *addr) {
|
|||||||
slab_t *search = cache->list;
|
slab_t *search = cache->list;
|
||||||
do {
|
do {
|
||||||
search = search->next;
|
search = search->next;
|
||||||
} while (search != cache->list && search->reference_count != cache->size && (search->reference_count != 0 || search == slab));
|
} while (search != cache->list && search->reference_count != cache->slab_object_count && (search->reference_count != 0 || search == slab));
|
||||||
|
|
||||||
// if the list points to this slab and the next one is a partial, set the list to it
|
// if the list points to this slab and the next one is a partial, set the list to it
|
||||||
// otherwise, the next is full (refcount 0) or empty (refcount == slab_object_count), which means this slab will be still be the next one to
|
// otherwise, the next is full (refcount 0) or empty (refcount == slab_object_count), which means this slab will be still be the next one to
|
||||||
|
|||||||
Reference in New Issue
Block a user