summaryrefslogtreecommitdiff
path: root/chapter33/docs/growing-array-rewrites.md
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2026-11-23 16:45:54 -0800
committerCliff Click <cliffc@acm.org>2026-11-23 16:45:54 -0800
commitc7b2a8edc93a313728c59353dd7df5ff3abf26b7 (patch)
tree2ecb0ab0cb1a1aaa62d77b2e1b844dcac35f4365 /chapter33/docs/growing-array-rewrites.md
parent96f150b05516bc254c4035821c0119db1ecce301 (diff)
downloadSimple-c7b2a8edc93a313728c59353dd7df5ff3abf26b7.tar.gz
Simple-c7b2a8edc93a313728c59353dd7df5ff3abf26b7.zip
Next round auto-mem analysis donech33
Diffstat (limited to 'chapter33/docs/growing-array-rewrites.md')
-rw-r--r--chapter33/docs/growing-array-rewrites.md13
1 files changed, 7 insertions, 6 deletions
diff --git a/chapter33/docs/growing-array-rewrites.md b/chapter33/docs/growing-array-rewrites.md
index 4bb0d141..cd9257d3 100644
--- a/chapter33/docs/growing-array-rewrites.md
+++ b/chapter33/docs/growing-array-rewrites.md
@@ -244,12 +244,13 @@ Both examples have a natural end of growth, so neither needs `finish(buf)` or
while growth is allowed. Scope exit does not guess the number of bytes a native
call wrote: `io.read` must explicitly set the final length from `used`.
-For a non-moving implementation, the returned storage must already be in an
-area that survives the callee, or its owning storage group must transfer to the
-result's destination. Ordinary callee-local RSP storage cannot simply survive a
-return. A chunk-chain handle can transfer ownership of storage, but a chain of
-nonadjacent chunks is not one contiguous `u8[]`. Neither syntax example resolves
-that placement choice by itself.
+The agreed placement is a parallel growable data stack, separate from the control
+stack. Its top is hidden call state; the updated top returns with the finished
+array. The caller's owning lifetime eventually restores the saved data-stack
+mark. A contiguous reserved address range lets the array grow without moving,
+subject to a checked capacity limit. This resolves the result destination without
+a final copy or relocating return addresses and spills. Actual lowering is still
+pending; retained inner results can still block an outer builder's growth.
Growing a non-moving array preserves existing interior references. Trimming is
different: references into the removed tail must be gone before that storage is