Crate memx

source ·
Expand description

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

Modules

Structs

Functions

  • This mimics libc::memchr(), same as buf.iter().position(|&x| x == by1).
  • This is same as buf.iter().position(|&x| x == by1 || x == by2).
  • This is same as buf.iter().position(|&x| x == by1 || x == by2 || x == by3 || x == by4).
  • This is same as buf.iter().position(|&x| x == by1 || x == by2 || x == by3).
  • This mimics libc::memcmp(), same as a.cmp(&b).
  • This mimics libc::memcpy(), same as dst = src.
  • This mimics libc::bcmp(), same as a == b.
  • This mimics libc::memmem(), same as (haystack as &str).find(needle as &str) or haystack.windows(needle.len()).position(|window| window == needle).
  • This is same as buf.iter().position(|&x| x != by1), not included libc.
  • This is same as buf.iter().position(|&x| x != by1 && x != by2), not included libc.
  • This is same as buf.iter().position(|&x| x != by1 && x != by2 && x != by3 && x != by4), not included libc.
  • This is same as buf.iter().position(|&x| x != by1 && x != by2 && x != by3), not included libc.
  • This mimics libc::memrchr(), same as buf.iter().rposition(|&x| x == by1).
  • This is same as buf.iter().rposition(|&x| x == by1 || x == by2).
  • This is same as buf.iter().rposition(|&x| x == by1 || x == by2 || x == by3 || x == by4).
  • This is same as buf.iter().rposition(|&x| x == by1 || x == by2 || x == by3).
  • This mimics libc::memrmem(), same as (haystack as &str).rfind(needle as &str) or haystack.windows(needle.len()).rposition(|window| window == needle).
  • This is same as buf.iter().rposition(|&x| x != by1), not included libc.
  • This is same as buf.iter().rposition(|&x| x != by1 && x != by2), not included libc.
  • This is same as buf.iter().rposition(|&x| x != by1 && x != by2 && x != by3 && x != by4), not included libc.
  • This is same as buf.iter().rposition(|&x| x != by1 && x != by2 && x != by3), not included libc.
  • This mimics libc::memset(), same as buf.fill(c).