Support official Rust FFI bindings

Open
#1,405 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Active
Tech stack
c, rust

Research direction

Start by reviewing the existing mimalloc_rust wrapper and its hidden libmimalloc-sys crate, then compare Bun's mimalloc source mirror and FFI layer. Define the scope of the official Rust bindings, including which APIs and documentation must be exposed and how version updates will be maintained. Done means an official, up-to-date binding covering the intended mimalloc APIs.

Written by the indexing model from the issue text.

Description

Currently the most popular mimalloc Rust wrapper is https://github.com/purpleprotocol/mimalloc_rust, but it only exposes mimalloc as a global allocator and all the rich features such as Arenas are missing or only available in the hidden libmimalloc-sys crate. The mimalloc version is also not up-to-date.

There are also other open-source projects building the mimalloc Rust FFI bindings themselves. An example of this is Bun: https://github.com/oven-sh/bun, where it mirrored the mimalloc source code and build a thin FFI layer itself.

It'd be good for the mimalloc to release its official Rust FFI bindings so that all the APIs, documentation, and bug fixes are up to date, just like how ms-quic has a core C implementation and at the same time expose its APIs to C++/C#/Rust: https://github.com/microsoft/msquic

Dominant language
C
Stars
13.4k
Forks
1.2k
Avg merge
4d 45m
Merged PRs (30d)
13

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/mimalloc

All issues in microsoft/mimalloc

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.