Skip to content

v0.85.0

Choose a tag to compare

@marcelocantos marcelocantos released this 27 Jul 05:34
· 52 commits to master since this release
c8405d1

🎯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::begin enables it for the stream/capture path. Direct mode pays nothing — the font file isn't even read.
  • Sprite::destroy now 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.