mirror of
https://github.com/storytold/lightcraft.git
synced 2026-11-02 06:27:53 -06:00
Review follow-up: a saturating usize count lost reservations. With a usize::MAX permit and an urgent 101-byte one, dropping the large one first reset the count to 0 while the 101 bytes were still held; and on a gate whose limit is usize::MAX the saturated sum never exceeded it, so a second holder didn't wait. The held count is now a u128 (exact for any number of usize permits); usage() reports it saturated to usize. The test covers both release orders and the usize::MAX limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PtjHGt5gnCHXgLt4NbGorf