#macro #lib #memory

mem_println

Shortcuts for debugging the size of value in bytes

2 releases

Uses new Rust 2021

0.1.5 Jun 28, 2022
0.1.4 Jun 25, 2022

#226 in Debugging

MIT/Apache

3KB

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

  • get_size_of_val
  • println_mem