unsafe fn finish_grow<A>(
new_layout: Layout,
current_memory: Option<(NonNull<u8>, Layout)>,
alloc: &mut A,
) -> Result<NonNull<[u8]>, TryReserveError>where
A: Allocator,
🔬This is a nightly-only experimental API. (
raw_vec_internals
)Expand description
§Safety
If current_memory
matches Some((ptr, old_layout))
:
ptr
must denote a block of memory currently allocated viaalloc
old_layout
must fit that block of memorynew_layout
must have the same alignment asold_layout
new_layout.size()
must be greater than or equal toold_layout.size()
Ifcurrent_memory
isNone
, this function is safe.