Hacker News new | ask | show | jobs
by edmondx 62 days ago
Clean approach. We deal with similar memory lifecycle problems in a PHP async extension (C, libuv-based reactor). Coroutine stacks and their associated state need deterministic cleanup when a coroutine completes or gets cancelled — arenas with scope-based cleanup would be a natural fit there.

The O(1) cleanup claim is interesting. How does it handle cross-arena references? In our case a coroutine can capture a reference to an object owned by a parent scope, and that's where simple arena strategies usually fall apart.