pr6.7
This commit is contained in:
@@ -25,6 +25,13 @@
|
||||
//! element count (arrays) or byte length (strings). Exact interpretation is
|
||||
//! defined by each object kind; the GC treats it as an opaque metadata field.
|
||||
//!
|
||||
//! Closure-specific note: for `ObjectKind::Closure`, `payload_len` is the
|
||||
//! fixed size `8` and the payload layout is exactly two little-endian `u32`s:
|
||||
//! `[fn_id][env_len]`. The captured environment values themselves are NOT in
|
||||
//! the raw payload; they live in a separate GC-visible area managed by the
|
||||
//! heap (see `Heap`), and the GC must traverse exactly `env_len` values from
|
||||
//! that environment slice.
|
||||
//!
|
||||
//! Notes:
|
||||
//! - The GC only relies on `flags` (mark bit) and `kind` to traverse/trace.
|
||||
//! Actual traversal logic will be implemented elsewhere in future PRs.
|
||||
@@ -52,7 +59,13 @@ pub enum ObjectKind {
|
||||
/// Homogeneous array of VM values/handles. `payload_len` is element count.
|
||||
Array = 2,
|
||||
|
||||
/// Compiled closure/function value. Fixed-size payload (implementation-defined).
|
||||
/// Compiled closure/function value.
|
||||
///
|
||||
/// Invariants for `payload_len` and payload layout:
|
||||
/// - `payload_len == 8` (fixed).
|
||||
/// - payload bytes are `[fn_id: u32][env_len: u32]` (little-endian).
|
||||
/// - The `env_len` captured values are stored out-of-line in the heap so
|
||||
/// they remain directly visible to the GC during traversal.
|
||||
Closure = 3,
|
||||
|
||||
/// Byte buffer / blob. `payload_len` is the number of bytes.
|
||||
|
||||
Reference in New Issue
Block a user