9 releases (breaking)

new 0.8.0 Oct 30, 2024
0.6.0 May 11, 2024
0.5.0 Mar 16, 2024
0.1.1 Jul 15, 2022

#854 in Development tools

Download history 525/week @ 2024-07-12 430/week @ 2024-07-19 410/week @ 2024-07-26 216/week @ 2024-08-02 409/week @ 2024-08-09 487/week @ 2024-08-16 607/week @ 2024-08-23 723/week @ 2024-08-30 509/week @ 2024-09-06 466/week @ 2024-09-13 253/week @ 2024-09-20 319/week @ 2024-09-27 148/week @ 2024-10-04 432/week @ 2024-10-11 210/week @ 2024-10-18 416/week @ 2024-10-25

1,218 downloads per month
Used in 75 crates (4 directly)

MIT license

11KB
123 lines

Module :: mem_tools

experimental rust-status docs.rs Open in Gitpod discord

Collection of tools to manipulate memory.

Performant size / pointer / region / data comparing.

Basic use-case


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 examples/mem_tools_trivial
cargo run

Sample

discord Open in Gitpod docs.rs docs.rs](https://docs.rs/meta_tools)

No runtime deps

Features