#allocator #malloc #callgrind #cachegrind

linear-malloc

一个超级简单的单线程线性分配器

1个不稳定版本

0.1.0 2022年2月22日

#329 in FFI

MIT/Apache

5KB

linear-malloc

Latest version Documentation

免责声明!这是一个为了测试而快速编写的代码。不要使用!

一个超级简单的单线程线性分配器。

对于使Cachegrind/Callgrind下运行的程序输出更稳定是有用的(因为它不会尝试执行系统分配器所做的智能优化)。

用法

Linux

cargo build
LD_PRELOAD=./target/debug/liblinear_malloc.so your-binary

macOS

cargo build
DYLD_INSERT_LIBRARIES=./target/debug/liblinear_malloc.dylib DYLD_FORCE_FLAT_NAMESPACE=1 your-binary

致谢

@mtrebi的 memory-allocators 获得有关分配策略的一些有用信息,并且 @ezrosent的 "Allocators in Rust" 是帮助设置基本框架的好来源。

依赖项

~43KB