slab_private: Use malloc_etc/free_etc instead of the block allocator.

Under normal circumstances (slab allocator) this change is a no-op
because malloc_etc just calls block_alloc unconditionally. Under
the debug or guarded heap, this makes allocations go through that
instead.
This commit is contained in:
Augustin Cavalier 2019-07-12 22:26:05 -04:00
parent c90c06ef59
commit e1b5172126

View File

@ -19,9 +19,7 @@ static const size_t kMinObjectAlignment = 8;
void request_memory_manager_maintenance();
void* block_alloc(size_t size, size_t alignment, uint32 flags);
void* block_alloc_early(size_t size);
void block_free(void* block, uint32 flags);
void block_allocator_init_boot();
void block_allocator_init_rest();
@ -51,14 +49,14 @@ slab_internal_alloc(size_t size, uint32 flags)
if (flags & CACHE_DURING_BOOT)
return block_alloc_early(size);
return block_alloc(size, 0, flags);
return malloc_etc(size, flags);
}
static inline void
slab_internal_free(void* buffer, uint32 flags)
{
block_free(buffer, flags);
free_etc(buffer, flags);
}