Struct wasmtime_environ::GcArrayLayout
source · pub struct GcArrayLayout {
pub base_size: u32,
pub align: u32,
pub elem_size: u32,
}
Expand description
The layout of a GC-managed array.
This layout is only valid for use with the GC runtime that created it. It is not valid to use one GC runtime’s layout with another GC runtime, doing so is memory safe but will lead to general incorrectness like panics and wrong results.
All offsets are from the start of the object; that is, the size of the GC header (for example) is included in the offset.
All arrays are composed of the generic VMGcHeader
, followed by
collector-specific fields, followed by the contiguous array elements
themselves. The array elements must be aligned to the element type’s natural
alignment.
Fields§
§base_size: u32
The size of this array object, without any elements.
The array’s elements, if any, must begin at exactly this offset.
align: u32
The alignment of this array.
elem_size: u32
The size and natural alignment of each element in this array.
Implementations§
source§impl GcArrayLayout
impl GcArrayLayout
sourcepub fn size_for_len(&self, len: u32) -> u32
pub fn size_for_len(&self, len: u32) -> u32
Get the total size of this array for a given length of elements.
sourcepub fn elem_offset(&self, i: u32) -> u32
pub fn elem_offset(&self, i: u32) -> u32
Get the offset of the i
th element in an array with this layout.
Trait Implementations§
source§impl Clone for GcArrayLayout
impl Clone for GcArrayLayout
source§fn clone(&self) -> GcArrayLayout
fn clone(&self) -> GcArrayLayout
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for GcArrayLayout
impl Debug for GcArrayLayout
source§impl From<GcArrayLayout> for GcLayout
impl From<GcArrayLayout> for GcLayout
source§fn from(layout: GcArrayLayout) -> Self
fn from(layout: GcArrayLayout) -> Self
Auto Trait Implementations§
impl Freeze for GcArrayLayout
impl RefUnwindSafe for GcArrayLayout
impl Send for GcArrayLayout
impl Sync for GcArrayLayout
impl Unpin for GcArrayLayout
impl UnwindSafe for GcArrayLayout
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)