gear_stack_buffer

Function with_byte_buffer

Source
pub fn with_byte_buffer<T>(
    size: usize,
    f: impl FnOnce(&mut [MaybeUninit<u8>]) -> T,
) -> T
Expand description

Calls function f with provided uninitialized byte buffer allocated on stack.

ยงIMPORTANT

If buffer size is too big (currently bigger than 0x10000 bytes), then allocation will be on heap. If buffer is small enough to be allocated on stack, then real allocated buffer size will be size aligned to 16 bytes.