mem_println

Shortcuts for debugging the size of value in bytes

2 releases

0.1.5 Jun 28, 2022
0.1.4 Jun 25, 2022

#421 in Profiling

MIT/Apache

4KB

This crate provides macro shorthand for displaying size of given value in bytes. This can be handy when you want to write less code for debugging to determine how much space is allocated for a variable.

Example:

#[macro_use]
extern crate mem_println;
use mem_println::mem;

fn foo() {
    let value: i32 = 10;
    mem!(value);      // println!("{}", mem::size_of_val(&value));
}

No runtime deps

Features