Info
This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Realloc Layout for Box<[MaybeUninit]>?
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