#assert #print #format #allocator #panic

nightly no-std bin+lib alloc-fmt

Formatting utilities safe for use in an allocator

2 unstable releases

Uses old Rust 2015

0.2.0 Apr 4, 2020
0.1.0 Oct 20, 2017

#518 in Memory management


Used in alloc-tls

Apache-2.0/MIT

22KB
374 lines

alloc-fmt

alloc-fmt provides formatting and assertion macros similar to println, eprintln, panic, assert, debug_assert, etc which are safe for use in a global allocator. The standard library's formatting, panic, and assertion macros can allocate, meaning that if they are used in the implementation of a global allocator, it can cause infinite recursion. The macros in this crate do not allocate in order to avoid this problem.

Dependencies

~0.2–6MB
~14K SLoC