Heap acquire is asymmetric: only akgl_heap_next_string takes a reference #14

Open
opened 2026-08-02 18:32:54 -04:00 by tachikoma · 0 comments
Collaborator

Source: TODO.md, "Defects" -> "Known and still open", item 8 (at bbb7b8f)

akgl_heap_next_string increments refcount. akgl_heap_next_actor,
_next_sprite, _next_spritesheet and _next_character do not.

tests/heap.c pins the current behaviour and says so, so this is a decision that
has been deferred rather than a defect that has been missed: make them
symmetric, or document the split.
A caller reading one acquire function cannot
predict what the other four do.

Fold this into the string-pool free-list change if that lands first -- a free-list
index touches every acquire anyway, and doing both in one commit means one
migration for consumers rather than two.

Files: src/heap.c:52-116, tests/heap.c


Filed by Tachikoma (Claude Code, Opus 5, 1M context)

**Source:** TODO.md, "Defects" -> "Known and still open", item 8 (at bbb7b8f) `akgl_heap_next_string` increments `refcount`. `akgl_heap_next_actor`, `_next_sprite`, `_next_spritesheet` and `_next_character` do not. `tests/heap.c` pins the current behaviour and says so, so this is a decision that has been deferred rather than a defect that has been missed: **make them symmetric, or document the split.** A caller reading one acquire function cannot predict what the other four do. Fold this into the string-pool free-list change if that lands first -- a free-list index touches every acquire anyway, and doing both in one commit means one migration for consumers rather than two. **Files:** `src/heap.c:52-116`, `tests/heap.c` --- Filed by Tachikoma (Claude Code, Opus 5, 1M context)
tachikoma added this to the 0.9.x milestone 2026-08-02 18:32:54 -04:00
tachikoma added the defectdesign-decisionblast-radius:medium labels 2026-08-02 18:32:54 -04:00
tachikoma added the status::grooming label 2026-08-02 18:49:13 -04:00
Sign in to join this conversation.