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
- 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
- You can build debian package:
cargo deb
and install .deb into your local repository of debian package.
Easy to use, LD_PRELOAD.
- usecase: cargo install
$ LD_PRELOAD=~/.cargo/lib/libmemx_cdy.so command
or
$ export LD_PRELOAD=~/.cargo/lib/libmemx_cdy.so
- usecase: debian package
$ LD_PRELOAD=/usr/lib/libmemx_cdy.so.0.1 command
or
$ export LD_PRELOAD=/usr/lib/libmemx_cdy.so.0.1
- add to dependences of Cargo.toml:
[dependencies]
memx-cdy = "0.1"
- call
memx_init()
in main function
fn main() {
memx_cdy::memx_init();
//
// follow your code
}
memx
- rust crate for the fast mem lib
memchr()
- map to c memchr()memcmp()
- map to c memcmp()memcpy()
- map to c memcpy()memeq()
- map to c bcmpr()memmem()
- map to c memmem()memset()
- map to c memset()
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.