Function gear_stack_buffer::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.