purpleprotocol / mimalloc_rust

A Rust wrapper over Microsoft's MiMalloc memory allocator
MIT License
481 stars 42 forks source link

Add Transparent Huge Pages options into configuration #113

Open karlovnv opened 2 months ago

karlovnv commented 2 months ago

Currently the only way way to configure underlying mimalloc is to use env variables, but it's very useful to set them up programatically.

So the idea is to add rust bindings for mi_option_set: https://microsoft.github.io/mimalloc/group__options.html#gaf84921c32375e25754dc2ee6a911fa60

nathaniel-daniel commented 1 month ago

You can just use the sys library to access those options. I don't think it's possible to provide a safe wrapper around those functions since they are:

  1. Not threadsafe
  2. Can cause unsafe behavior