Skip to content

Switch back to mimalloc v3 #786

Open

Description

@hombit

Mimalloc v3.3.0-3.3.2 is affected by a multithreading bug (microsoft/mimalloc#1287), which is why we switched to v2 in #694. We should try to switch back after the next version of mimalloc is released and propagates into the Rust crate. We should track libmimalloc-sys releases: https://lib.rs/crates/libmimalloc-sys (probably this PR purpleprotocol/mimalloc_rust#169)

Activity

  1. chirizxc commented on Aug 8, 2026

    @chirizxc

    Also see: lava-sh/toml-rs#229

    [target.'cfg(not(any(target_os = "macos", target_os = "windows")))'.dependencies]
    mimalloc = {
        # mimalloc v3
        optional = true,
        version = "=0.1.52",
        features = [
            "override",
            "local_dynamic_tls",
        ]
    }
    
    [target.'cfg(target_os = "macos")'.dependencies]
    mimalloc = {
        # mimalloc v3
        optional = true,
        version = "=0.1.52",
        # See: https://github.com/lava-sh/toml-rs/issues/229
        #
        # mimalloc "override" feature installs process-wide malloc interposition and
        # replaces macOS malloc zone/fork hooks when the extension is imported via dlopen.
        # That breaks fork-based subprocess spawning, e.g., asyncio/playwright can fail.
        features = [
            "local_dynamic_tls",
        ]
    }
    
    
    [target.'cfg(target_os = "windows")'.dependencies]
    mimalloc = {
        # mimalloc v3
        optional = true,
        version = "=0.1.52",
        features = [
            "win_direct_tls",
        ]
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions