brotli::enc::combined_alloc

Function alloc_if

source
pub(crate) fn alloc_if<T, A: Allocator<T>>(
    condition: bool,
    alloc: &mut A,
    len: usize,
) -> A::AllocatedMemory
Expand description

Helper function to allocate memory or return a default value if the condition is false