#memcmp #memchr #memmem

memx

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

31 releases

0.1.32 Jun 19, 2024
0.1.30 May 15, 2023
0.1.28 Mar 14, 2023
0.1.21 Jun 13, 2022
0.1.14 Jul 6, 2021

#62 in Algorithms

Download history 914/week @ 2024-07-20 1015/week @ 2024-07-27 1201/week @ 2024-08-03 923/week @ 2024-08-10 767/week @ 2024-08-17 1095/week @ 2024-08-24 716/week @ 2024-08-31 1430/week @ 2024-09-07 1130/week @ 2024-09-14 1193/week @ 2024-09-21 1160/week @ 2024-09-28 975/week @ 2024-10-05 1220/week @ 2024-10-12 995/week @ 2024-10-19 976/week @ 2024-10-26 769/week @ 2024-11-02

4,003 downloads per month
Used in 19 crates (4 directly)

MIT/Apache

1MB
22K SLoC

memx

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

memx minics libc.

This crate is implemented memory functions like libc memcmp(), memchr(), memmem(), memcpy(), memset().

Features

  • Rewriting with rust lang.
  • minimum support rustc 1.56.1 (59eed8a2a 2021-11-01)

Todo

  • Support the zero overhead trait.
  • Support more fast routine on armv7-android
  • Support more fast routine on x86_64
  • Support #![no_std]

Support status of miri :: rustc 1.68.0-nightly (77429957a 2023-01-01)

Ok lists:

  • cargo +nightly miri test --target=x86_64-unknown-linux-gnu
  • cargo +nightly miri test --target=i686-unknown-linux-gnu
  • cargo +nightly miri test --target=i586-unknown-linux-gnu
  • cargo +nightly miri test --target=aarch64-unknown-linux-gnu
  • cargo +nightly miri test --target=armv7-unknown-linux-gnueabihf

Failed lists:

  • nothing

Benchmark results

forward search backward search
memchr() memrchr()
memnechr() memrnechr()
memmem() memrmem()
memchr_dbl() memrchr_dbl()
memchr_tpl() memrchr_tpl()
memchr_qpl() memrchr_qpl()
memnechr_dbl() memrnechr_dbl()
memnechr_tpl() memrnechr_tpl()
memnechr_qpl() memrnechr_qpl()
memory op
memcmp()
memeq()
memcpy()
memset()

Changelogs

This crate's changelog here.

License

This project is licensed under either of

at your option.

Dependencies