#memcmp #memchr #memmem

memx-cdy

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

12 releases

0.1.12 Feb 13, 2023
0.1.11 Jan 31, 2023
0.1.8 Jun 13, 2022
0.1.7 Nov 14, 2021
0.1.3 Jun 24, 2021

#427 in Algorithms

Download history 312/week @ 2023-02-13 387/week @ 2023-02-20 24/week @ 2023-02-27 160/week @ 2023-03-06 86/week @ 2023-03-13 25/week @ 2023-03-20 92/week @ 2023-03-27 51/week @ 2023-04-03 47/week @ 2023-04-10 30/week @ 2023-04-17 102/week @ 2023-04-24 127/week @ 2023-05-01 58/week @ 2023-05-08 60/week @ 2023-05-15 34/week @ 2023-05-22 163/week @ 2023-05-29

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

MIT/Apache

13KB
120 lines

memx-cdy

crate Docs Rust Version Apache2/MIT licensed Test ubu Test mac Test win

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

~1MB
~24K SLoC