3 ms·
Manually calling free sounds like an optimization, especially in a language that does not tag pointer values and as result would leak allocations all over the p
by josefx 4y ago
Manually calling free sounds like an optimization, especially in a language that does not tag pointer values and as result would leak allocations all over the place.
- samus 4y agoThere's another problem: this kind of GC doesn't know much about the memory layout of the objects it manages, but only the addresses. When it finds a byte pattern in memory that looks like it belongs to the objects it manages, it has to assume they are live. Sprinkling in `free()` whenever it can be judged to be safe helps to minimize this issue.