Crate memx[][src]

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.46.0 (04488afe3 2020-08-24)

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.56.0-nightly (a6ece5615 2021-08-03)

Ok lists:

  • cargo miri test –target=i586-unknown-linux-gnu
  • cargo miri test –target=aarch64-unknown-linux-gnu
  • cargo miri test –target=armv7-unknown-linux-gnueabihf

Failed lists:

  • cargo miri test –target=x86_64-unknown-linux-gnu
  • cargo miri test –target=i686-unknown-linux-gnu

miri error: unimplemented intrinsic: simd_eq

Modules

Structs

used by memcpy()

Functions

This mimics libc::memchr(), same as buf.iter().position(|&x| x == c).

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 != c), not included libc.

This mimics libc::memrchr(), same as buf.iter().rposition(|&x| x == c).

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 != c), not included libc.

This mimics libc::memset(), same as buf.fill(c).