diff options
| author | Taylan Kammer <taylan.kammer@gmail.com> | 2026-06-29 05:35:54 +0200 |
|---|---|---|
| committer | Taylan Kammer <taylan.kammer@gmail.com> | 2026-06-29 05:35:54 +0200 |
| commit | d5259ed20eae38bb4f732d829b927dd54cfac5f5 (patch) | |
| tree | f05b649c24f8b7f16d92a7bf45e8bc38045c91e0 /src/zisp/value/array.zig | |
| parent | 2b064f4a5f68e65e7f10abbb00ad7fef2f287463 (diff) | |
Minor cleanup.
Diffstat (limited to 'src/zisp/value/array.zig')
| -rw-r--r-- | src/zisp/value/array.zig | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/zisp/value/array.zig b/src/zisp/value/array.zig index 34e75b9..cdc5f75 100644 --- a/src/zisp/value/array.zig +++ b/src/zisp/value/array.zig @@ -50,13 +50,13 @@ const Value = value.Value; /// Other remaining bits provide information about element type and size. pub const ArrayPtr = *align(@alignOf(value.Zptr)) ArrayHeader; -// Important: We may use a hack where lists, residing in their own heap region, -// can be turned into value arrays by transforming their first element into an -// ArrayHeader. However, it might simplify the GC algorithm if the entirety of -// that heap region can be treated as Value slots. If we ensure that ArrayHead -// never looks like a Value with a pointer payload, this will be safe; as such, -// we ensure that it has some of the "exponent" bits unset, making it always -// look like a regular Double value. This is what "_DONTUSE" is for. +// Important: We may or may not use a hack one day in which an algorithm, like +// for GC purposes, scans through certain memory regions looking for NaN-packed +// pointers conservatively. If we ever decide to do this, there's a chance it +// may come across ArrayHeader instances and treats them like a Value. We can +// ensure that, even then, an ArrayHeader can't be confused for a NaN-packed +// pointer, by ensuring that some of the high bits are unset, so it has the +// format of a regular Double. This is what "_DONTUSE" is for. pub const ArrayHeader = packed struct(u64) { len_or_ptr: u48, is_slice: bool = false, |
