diff options
Diffstat (limited to '')
| -rw-r--r-- | src/mimalloc_arena.zig | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mimalloc_arena.zig b/src/mimalloc_arena.zig index 9fa0b586e..db7a6c368 100644 --- a/src/mimalloc_arena.zig +++ b/src/mimalloc_arena.zig @@ -27,6 +27,10 @@ pub const Arena = struct { return Arena{ .heap = mimalloc.mi_heap_new() orelse return error.OutOfMemory }; } + pub fn gc(this: Arena, force: bool) void { + mimalloc.mi_heap_collect(this.heap, force); + } + const MI_MAX_ALIGN_SIZE = 16; inline fn mi_malloc_satisfies_alignment(alignment: usize, size: usize) bool { return (alignment == @sizeOf(*anyopaque) or (alignment == MI_MAX_ALIGN_SIZE and size > (MI_MAX_ALIGN_SIZE / 2))); |
