From b5a620e5f133bea5e2009ec7b3021ba8bc5250d2 Mon Sep 17 00:00:00 2001 From: 4lDO2 <4lDO2@protonmail.com> Date: Sat, 6 May 2023 14:42:33 +0200 Subject: [PATCH] Fix mspaces not being protected by locks. --- src/platform/allocator/dlmalloc.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/platform/allocator/dlmalloc.rs b/src/platform/allocator/dlmalloc.rs index c94268559..212b4caa4 100644 --- a/src/platform/allocator/dlmalloc.rs +++ b/src/platform/allocator/dlmalloc.rs @@ -61,5 +61,7 @@ pub unsafe fn free(ptr: *mut c_void) { } pub fn new_mspace() -> usize { - unsafe { create_mspace(0, 0) } + let capacity = 0; // don't specify capacity explicitly + let locked = 1; + unsafe { create_mspace(capacity, locked) } } -- GitLab