Expand description

c interface of memx: the fast memory functions like libc memcmp(), memchr(), memmem(), memcpy(), memset()


  • Faster os libc and musl libc
  • Replace dynamic os libc using LD_PRELOAD

Quick install

  1. You can install this into cargo lib path:
cargo build --release
mkdir -p $HOME/.cargo/lib
cp -a target/release/libmemx_cdy.so target/release/libmemx_cdy.a $HOME/.cargo/lib
  1. You can build debian package:
cargo deb

and install .deb into your local repository of debian package.


Easy to use, LD_PRELOAD.

  1. usecase: cargo install
$ LD_PRELOAD=~/.cargo/lib/libmemx_cdy.so command


$ export LD_PRELOAD=~/.cargo/lib/libmemx_cdy.so
  1. usecase: debian package
$ LD_PRELOAD=/usr/lib/libmemx_cdy.so.0.1 command


$ export LD_PRELOAD=/usr/lib/libmemx_cdy.so.0.1

2-step of using on your rust source code

  1. add to dependences of Cargo.toml:
memx-cdy = "0.1"
  1. call memx_init() in main function
fn main() {
    // follow your code


This is the dummy function fot the easy linking.