Skip to content

Runtime object layout

  • Word 0: type descriptor pointer.
  • Optional: object size for debugging/profiling.
  • Size, alignment.
  • Pointer bitmap/offset list for GC scanning.
  • {ptr, len} where ptr points to UTF-8 bytes.
  • {ptr, len, cap} where ptr points to contiguous elements.
  • Element layout comes from type descriptor.
  • Heap-allocated with header + fields.
  • Field offsets follow alignment rules.