Repository navigation
v0.85.0
🎯T169 — cmdstream image-recipe leak (critical)
Every direct-mode ge game leaked ~2.3 MB of native heap per rendered frame: rasterizeText registered a stream-only image recipe unconditionally, copying the full font file per rasterized string into a registry keyed by never-recycled sokol id generations, with no erasure. Changing HUD/clock text produced one registration per frame — 24 GB desktop RSS in ~80 s; foreground lmkd kill on 8 GB Android tablets within minutes.
Fixed
- Recipe registration is off by default (
cmdstream::setImageRecipesEnabled);LiveCapture::beginenables it for the stream/capture path. Direct mode pays nothing — the font file isn't even read. Sprite::destroynow unregisters its image, so an enabled registry mirrors live textures instead of growing per rasterization.- Font bytes are cached per path (one copy per font, no per-string disk reads).
Added
cmdstream::imageRecipesEnabled/unregisterImage/imageRecipeCount.
Known limitation (T128.2 spike scope): textures created before the first capture arm carry no recipes; the experimental SP2S replay should retro-register or fall back when it graduates.
Verification: yw2 desktop RSS flat over 30 s soaks on both render paths (was ~250 MB/s); 386/386 unit tests.