fix: freeze objects when their reference count overflows

This PR prevents memory corruption when an object's 32-bit reference count overflows.
Previously, forcing a very large number of references to a single object wrapped the
counter and corrupted the object's state; the object is now frozen (treated as persistent)
and simply never freed, following the "sticky" approach used by Koka.
https://github.com/koka-lang/koka
2 files changed