summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-01-29 10:41:18 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-02-06 01:43:56 -0500
commit2d6f0b17e3ce9326abd43e187910db0a5e519efa (patch)
tree8692614e8cc82b6b885beb53eeb071f87c617bbe
parent88ef270aa0cecf2463396f93a273656de9df9433 (diff)
downloadhaskell-2d6f0b17e3ce9326abd43e187910db0a5e519efa.tar.gz
rts/m32: Free large objects back to the free page pool
Not entirely convinced that this is worth doing.
-rw-r--r--rts/linker/M32Alloc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/rts/linker/M32Alloc.c b/rts/linker/M32Alloc.c
index a95204151b..b86cb8b813 100644
--- a/rts/linker/M32Alloc.c
+++ b/rts/linker/M32Alloc.c
@@ -373,7 +373,7 @@ m32_allocator_unmap_list(struct m32_page_t *head)
while (head != NULL) {
ASSERT_VALID_PAGE(head);
struct m32_page_t *next = m32_filled_page_get_next(head);
- munmapForLinker((void *) head, head->filled_page.size, "m32_allocator_unmap_list");
+ m32_release_page(head);
head = next;
}
}
@@ -388,10 +388,9 @@ void m32_allocator_free(m32_allocator *alloc)
m32_allocator_unmap_list(alloc->protected_list);
/* free partially-filled pages */
- const size_t pgsz = getPageSize();
for (int i=0; i < M32_MAX_PAGES; i++) {
if (alloc->pages[i]) {
- munmapForLinker(alloc->pages[i], pgsz, "m32_allocator_free");
+ m32_release_page(alloc->pages[i]);
}
}