Function nstd_sys::vec::nstd_vec_reserve

source ·
#[no_mangle]
pub extern "C" fn nstd_vec_reserve(
    vec: &mut NSTDVec,
    size: NSTDUInt
) -> NSTDAllocError
Available on crate feature nstd_vec only.
Expand description

Reserves some space on the heap for at least size more elements to be pushed onto a vector without making more allocations.

Parameters:

  • NSTDVec *vec - The vector to reserve space for.

  • NSTDUInt size - The number of additional elements to allocate for.

Returns

NSTDAllocError errc - The allocation operation error code.

Panics

This operation will panic if size is zero.