From d5259ed20eae38bb4f732d829b927dd54cfac5f5 Mon Sep 17 00:00:00 2001 From: Taylan Kammer Date: Mon, 29 Jun 2026 05:35:54 +0200 Subject: Minor cleanup. --- src/zisp/value/array.zig | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/zisp/value/array.zig') 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, -- cgit v1.2.3