4 ms·
I'm kinda confused about what you said regarding free(). The linked Github page has a free(), but it doesn't appear to be a NOOP.
by pubby 4y ago
I'm kinda confused about what you said regarding free(). The linked Github page has a free(), but it doesn't appear to be a NOOP.
- asah 4y agoif you point to the code snippet, I can look further - but in the very original design the whole point is that free() doesn't need to be called, which is the point of automatic memory management (of which GC is an example). I'm assuming in optimized implementation, if the user calls free() explicitly there can be performance optimizations but again these calls must be optional and therefore it is legal to make the free() into a NOOP.
- astrange 4y agoSince Boehm is a conservative GC, it sometimes won't be able to free things because it can't eliminate every false positive. So I guess you might want to free some things sometimes. Although I don't see many situations where this would happen reliably so that you'd know when it's needed.