actually lets downgrade mimalloc

This commit is contained in:
Jarred Sumner
2025-03-29 05:55:42 -07:00
parent 0860131df4
commit fe6f462cdb
4 changed files with 7 additions and 2 deletions

View File

@@ -4,7 +4,7 @@ register_repository(
REPOSITORY
oven-sh/mimalloc
COMMIT
7d4ee623861ddd5561503a5205df7cf8e8d0623c
7085b6cec31641fddaca3d40932cda82e91baf07
)
set(MIMALLOC_CMAKE_ARGS

View File

@@ -212,3 +212,6 @@ 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)));
}
pub const mi_arena_id_t = ?*anyopaque;
pub extern fn mi_heap_new_ex(heap_tag: c_int, allow_destroy: bool, arena_id: mi_arena_id_t) ?*Heap;

View File

@@ -186,7 +186,7 @@ pub const Arena = struct {
}
pub fn init() !Arena {
const arena = Arena{ .heap = mimalloc.mi_heap_new() orelse return error.OutOfMemory };
const arena = Arena{ .heap = mimalloc.mi_heap_new_ex(0, true, null) orelse return error.OutOfMemory };
// if (comptime Environment.isDebug) {
// ArenaRegistry.register(arena);
// }

View File

@@ -261,3 +261,5 @@ extern "C" bool icu_hasBinaryProperty(UChar32 cp, unsigned int prop)
{
return u_hasBinaryProperty(cp, static_cast<UProperty>(prop));
}
extern "C" __attribute__((weak)) void mi_thread_set_in_threadpool() {}