2 releases

0.1.1 Jul 15, 2022
0.1.0 Jun 26, 2022

#467 in Development tools

Download history 617/week @ 2023-02-08 585/week @ 2023-02-15 900/week @ 2023-02-22 210/week @ 2023-03-01 231/week @ 2023-03-08 2442/week @ 2023-03-15 989/week @ 2023-03-22 647/week @ 2023-03-29 169/week @ 2023-04-05 779/week @ 2023-04-12 1195/week @ 2023-04-19 1150/week @ 2023-04-26 548/week @ 2023-05-03 142/week @ 2023-05-10 103/week @ 2023-05-17 149/week @ 2023-05-24

957 downloads per month
Used in 57 crates (3 directly)

MIT license

1MB
27K SLoC

Module :: mem_tools

experimental rust-status docs.rs Open in Gitpod discord

Collection of tools to manipulate memory.

Performant size / pointer / region / data comparing.

Sample


use mem_tools as mem;

// Are two pointers are the same, not taking into accoint type.
// Unlike `std::ptr::eq()` does not require arguments to have the same type.
let src1 = ( 1, );
let src2 = ( 1, );
assert!( !mem::same_ptr( &src1, &src2 ) );

// Are two pointers points on data of the same size.
let src1 = "abc";
let src2 = "cba";
assert!( mem::same_size( src1, src2 ) );

// Are two pointers points on the same region, ie same size and same pointer.
// Does not require arguments to have the same type.
let src1 = "abc";
let src2 = "abc";
assert!( mem::same_region( src1, src2 ) );

To add to your project

cargo add mem_tools

Try out from the repository

git clone https://github.com/Wandalen/wTools
cd wTools
cd sample/rust/mem_tools_trivial
cargo run

No runtime deps