Skip to content

wenyuzhao/MallocKit

Repository files navigation

MallocKit

Getting Started

$ cargo build -p hoard --release --features malloc
$ env LD_PRELOAD=./target/release/libhoard.so cargo --help # or some other command

Run on macOS

$ env DYLD_INSERT_LIBRARIES=./target/release/libhoard.dylib cargo --help # or some other command

Note: If you'd like to hijack the system apps and libraries as well, disable System Integrity Protection (SIP). Do this at your own risk 😉

Tests

$ cargo test

Benchmarking

[Latest benchmark results]

Please use a linux distribution (e.g. Ubuntu or Fedora) and run cd bench && make setup to fetch and build all the benchmarks and third-party malloc algorithms.

python3 -m bench -a mi hd sys hoard -i 10 -e duration_time cycles cache-misses cache-references dTLB-load-misses dTLB-loads instructions page-faults --build

After the benchmark run is finished, please use bench/visual.ipynb for visualization.

Other usages of the benchmark tool:

  • python3 -m bench -a hoard -b cfrac --build --record -e dTLB-loads followed by perf report to record and analyze perf event data.
  • python3 -m bench -a hoard -b cfrac --build --test for a quick run of a single benchmark.
  • python3 -m bench -a hoard -b cfrac --build --lldb to run the benchmark binary with lldb.

TODO

  • Linux/x86_64 support
  • MacOS/x86_64 support
  • Windows/x86_64 support
  • Performance
  • Linux/aarch64 support
  • MacOS/aarch64 support
  • Windows/aarch64 support
  • Rust allocator interface