Macro atomic_dbg::dbg

source ·
macro_rules! dbg {
    () => { ... };
    ($val:expr $(,)?) => { ... };
    ($($val:expr),+ $(,)?) => { ... };
}
Expand description

Prints and returns the value of a given expression for quick and dirty debugging.

Similar to [std::dbg], except it:

  • Writes atomically, up to the greatest length supported on the platform.
  • Doesn’t use locks (in userspace).
  • Preserve libc’s errno and Windows’ last-error code value.

This allows it to be used to debug allocators, multi-threaded code, synchronization routines, startup code, and more.