mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-29 17:54:36 +01:00
Each object of a host class keeps its handle twice, once in its slot and once in the realm's index of the objects scripts hold, but creating one reserved only the object's own bytes, and the collector's live-byte total left the handle out. A host value with a long handle could therefore grow the heap past the script's limit. The object now reserves its handle's bytes before it is made, and the collector counts them for every live object. Tests cover a handle larger than the remaining budget and the bytes 100 retained objects add.