4 ms·
> can't be helped by good programming techniques, garbage collection, Rust's Drop trait, the C++ RAII way of thinking, deferred clean-up in languages like Zig o
by a1369209993 5y ago
> can't be helped by good programming techniques, garbage collection, Rust's Drop trait, the C++ RAII way of thinking, deferred clean-up in languages like Zig or Python, or anything else I'm aware of.
Arena allocation. Every allocation must be attributed to some arena (eg current tab, current network request, current frame being rendered, etc); when the arena goes away, so do all its allocations.
- tialaramex 5y agoGood idea. Not always appropriate, but there are a lot places I could have done this and didn't. Thanks.
- a1369209993 5y agoI'd say rather that it's always appropriate, but not always practical, but I suppose that's quibbling semantics.