From 28a529088f69b1ac52fccc8b77a035834457ab45 Mon Sep 17 00:00:00 2001 From: Orkuncakilkaya Date: Mon, 28 Sep 2026 02:09:35 +0300 Subject: [PATCH] changes: a dispatched action's record kept by the queue Co-Authored-By: Claude Opus 5.5 --- changes/dispatch-kept-records.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 changes/dispatch-kept-records.md diff --git a/changes/dispatch-kept-records.md b/changes/dispatch-kept-records.md new file mode 100644 index 00000000..04dcfd7d --- /dev/null +++ b/changes/dispatch-kept-records.md @@ -0,0 +1,10 @@ +bump: patch +type: fix +**A dispatched action no longer allocates a record each time.** `dispatch A { ... }` made a fresh +record for the queue, and Ludic frees nothing, so a system dispatching every frame (an input's +`Move`, a frame's time) grew the program by a record a frame. The queue now keeps a list per +action: a dispatch takes the next one (making one only when all are queued), fills every field +as `new` would - given, or its default - and `drain_actions()` hands them all back once the queue +is empty. A reducer reads its action only during the drain, so nothing sees a record after it is +reused; keep what must last in the state, not the action. `ludic.base`'s `actions_test` holds a +reused record getting its defaults back.