Registry / utility / malloc-size-of-derive

malloc-size-of-derive

JSON →
library0.1.3rscratesunverified

Derive macro for Firefox memory reporting, not intended for external use.

# Cargo.toml [dependencies] malloc_size_of_derive = "0.1.3"
INSTALL
IMPORT
SIG · MALLOC-SIZE-OF-DER
M
malloc-size-of-derive
utilityrustv0.1.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MallocSizeOf
use malloc_size_of_derive::MallocSizeOf;

Derives the MallocSizeOf trait for a struct to measure heap allocation.

use malloc_size_of_derive::MallocSizeOf; #[derive(MallocSizeOf)] struct MyStruct { data: Vec<u8>, } fn main() { let s = MyStruct { data: vec![0; 100] }; println!("Size: {}", s.size_of()); }
Debug
Known issues
gotchaThis crate is intended for Firefox internal use and may have unstable API.
fix
Avoid using in production code outside of Firefox; consider alternatives like `deepsize`.
affects: *
Upgrade
Version history
0.1.3latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
malloc-size-of-derive — cargo add malloc-size-of-derive · libregistry