fix(v4.0.0): wire review round 1 -- tests for the wake-up order and for waking only on enough room; no overflow moving a message; sleep for impossible room answers at once

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rajames
2026-10-08 14:12:33 -04:00
co-authored by Claude Opus 5.5
parent d5cd64605d
commit 83694b18be
6 changed files with 68 additions and 6 deletions
+1 -1
View File
@@ -118,7 +118,7 @@ int v4_wire_move(v4_wire_queue *from, v4_wire_queue *to)
if (from == to || v4_wire_room(to, n) != V4_WIRE_DONE) return V4_WIRE_NO_ROOM;
at = back(to, n);
for (i = 0; i < n; i++) to->cell[slot(to, at + i)] = from->cell[slot(from, from->mark + i)];
to->cell[slot(to, at + 3u)] = (v4_cell)(from->cell[slot(from, from->mark + 3u)] - 1);
to->cell[slot(to, at + 3u)] = (v4_cell)((v4_ucell)from->cell[slot(from, from->mark + 3u)] - 1u); /* in the unsigned type: no overflow at the least cell */
remove_marked(from);
return V4_WIRE_DONE;
}