#memcmp #memchr #memmem

memx-cdy

The fast memory functions like a libc memcmp(), memchr(), memmem(), memcpy(), memset()

6 releases

0.1.6 Sep 10, 2021
0.1.5 Sep 10, 2021
0.1.4 Jul 6, 2021
0.1.3 Jun 24, 2021

#395 in Algorithms

Download history 6/week @ 2021-06-27 23/week @ 2021-07-04 11/week @ 2021-07-11 18/week @ 2021-07-18 19/week @ 2021-07-25 23/week @ 2021-08-01 16/week @ 2021-08-08 16/week @ 2021-08-15 16/week @ 2021-08-22 3/week @ 2021-08-29 34/week @ 2021-09-05 16/week @ 2021-09-12 11/week @ 2021-09-19 8/week @ 2021-09-26 6/week @ 2021-10-03 18/week @ 2021-10-10

75 downloads per month
Used in 13 crates (12 directly)

MIT/Apache

10KB
98 lines

memx-cdy

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

Features

  • 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.

Usage

Easy to use, LD_PRELOAD.

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

or

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

or

$ 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:
[dependencies]
memx-cdy = "0.1"
  1. call memx_init() in main function
fn main() {
    memx_cdy::memx_init();
    //
    // follow your code
}

Changelogs

This crate's changelog here.

References

  • memx - rust crate for the fast mem lib

The memx benchmark results

License

This project is licensed under either of

at your option.

Dependencies

~280KB