diff --git a/src/mmc.c b/src/mmc.c index bd0cc958b..2db1b2cc5 100644 --- a/src/mmc.c +++ b/src/mmc.c @@ -395,7 +395,12 @@ heap_reset_large_object_pages(struct gc_heap *heap, size_t npages) { GC_ASSERT(npages <= previous); size_t bytes = (previous - npages) << heap_large_object_space(heap)->page_size_log2; - nofl_space_reacquire_memory(heap_nofl_space(heap), bytes); + // If heap size is fixed, we won't need to allocate any more nofl blocks, as + // nothing uses paged-out blocks except large object allocation. But if the + // heap can grow, growth can consume nofl-space blocks that were paged out to + // allow for lospace allocations, which means that here we may need to + // allocate additional slabs. + nofl_space_expand(heap_nofl_space(heap), bytes); } static void diff --git a/src/nofl-space.h b/src/nofl-space.h index bad9c315d..ea7fe1c31 100644 --- a/src/nofl-space.h +++ b/src/nofl-space.h @@ -1291,12 +1291,6 @@ nofl_space_maybe_reacquire_memory(struct nofl_space *space, size_t bytes) { return pending; } -static void -nofl_space_reacquire_memory(struct nofl_space *space, size_t bytes) { - ssize_t pending = nofl_space_maybe_reacquire_memory(space, bytes); - GC_ASSERT(pending + NOFL_BLOCK_SIZE > 0); -} - static int nofl_space_sweep_until_memory_released(struct nofl_space *space, struct nofl_allocator *alloc) {