Formatting and writing to a file without malloc or locks

It’s format! that allocates. It evaluates to a String, and String is heap-backed.

If you want to avoid allocation, use write! instead.