From cf737076e9b3bf0580a06410b40963b930972df6 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Fri, 25 Sep 2026 10:06:41 +0700 Subject: [PATCH] A moved Vec's old buffer is to be poisoned in a dev build, and the unread generation word goes --- TODO.org | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TODO.org b/TODO.org index 82913188..f3bf91a2 100644 --- a/TODO.org +++ b/TODO.org @@ -1242,7 +1242,8 @@ build, because a layout that changes with a build flag can disagree silently across the reload boundary. One addition: a budget, because =retry= needs a handler that can make the same request succeed. -** TODO The Vec generation word has no reader +** NEXT The Vec generation word has no reader +Decided 2026-09-25: remove the word, and in a dev build fill a Vec's old buffer with the dead-beef pattern when a push moves it, so a stale slice reads visibly wrong values. No slice layout change; a release build is untouched. Rules out a dev-only word on every slice. It is bumped on reallocation and read by nothing. The stale-slice trap it exists for needs a slice that can carry the Vec's identity, and a slice is pointer and length — so either slices grow a word in a dev build or the trap does not exist.