finish_grow

Function finish_grow 

Source
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 via alloc
  • old_layout must fit that block of memory
  • new_layout must have the same alignment as old_layout
  • new_layout.size() must be greater than or equal to old_layout.size() If current_memory is None, this function is safe.