aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-14 16:40:41 +0330
committerGravatar zinc <zinc@downsta.ir> 2026-10-14 16:40:41 +0330
commit00c41ff49d846b61997f7be7ce75793c5f677f0c (patch)
tree5eac855e5d20db81dc9d0fce4053194e24b1955a /src
parentx86-64 jit: inline enhancements (micro-ops lowered to registers, literal spec... (diff)
rt: note the two definitions of a heap block's length (bnd recipe, paylen)
Diffstat (limited to 'src')
-rw-r--r--src/runtime/rt.zc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/runtime/rt.zc b/src/runtime/rt.zc
index 7089e26..f1414e4 100644
--- a/src/runtime/rt.zc
+++ b/src/runtime/rt.zc
@@ -87,6 +87,10 @@ enhance ishl(a, b) micro "a = shl a b";
enhance lfa(k) micro "r1 = ld 589824; k = add r1 k";
// 1 when i is outside 0..n-1 (the unsigned compare also catches negative i), else 0.
enhance outside(i, n) micro "i = ltu i n; i = xor i 1";
+//: the block length has exactly two definitions, which must agree: the r7 lines of this
+//: recipe (the inline check on every backend; the x86-64 and arm64 jits lower it to
+//: registers, with nothing pointer-specific of their own) and paylen below (bchk's report).
+//: an exact-size check or a new header layout changes those two places and nothing else.
// the index check of a pointer, as one instruction: 1 when p is the start of a heap
// block (its check word p[-3] is p ^ MAGIC) and the byte or word offset i * m is not
// inside the block's payload (q units per word: 1 for word elements, 8 for packed