Warning
This post was published 47 days ago. The information described in this article may have changed.
I'd like to take a Box<[MaybeUninit<T>]>
, take the raw pointer out of it, and reallocate it. However, my specific concern is that the realloc
method specifies that:
layout
is the same layout that was used to allocate that block of memory
If the Box
was created via new_uninit_slice
, is it safe to assume that Layout::array::<T>(box.len())
is the correct Layout
builder to use for reallocating?
1 post - 1 participant
🏷️ rust_feed