Skip to main content

Module shape_array

Module shape_array 

Source
Expand description

Unified array backing store for VM and JIT.

ShapeArray is a #[repr(C)] container of ValueWord values with a C-ABI-stable memory layout that the JIT can access inline:

offset  0: data  โ€” *mut ValueWord (pointer to element buffer)
offset  8: len   โ€” u64 (number of elements)
offset 16: cap   โ€” u64 (allocated capacity)

Since ValueWord is #[repr(transparent)] over u64, the raw pointer can be read as *mut u64 by JIT-generated machine code without any casting or ABI mismatch.

ShapeArray replaces both:

  • Vec<ValueWord> (VM-side VMArray = Arc<Vec<ValueWord>>)
  • JitArray (JIT-side #[repr(C)] array of raw u64)

by providing one type with correct ValueWord clone/drop semantics and a stable C layout for the JIT.

Structsยง

ShapeArray
Unified array with C-ABI-stable layout for JIT and VM.