Boehm's a very good garbage collector, given this:
> A precise generational collector would perform far better but wouldn't be so easy to drop into a C codebase.
It's that last part that's key. Without language support at even the basic level, you won't get much better.
As for this "precise generational collector", I doubt it. Like everything, saying you need a GC all the time to be safe is just more boogey man fear mongering. You don't need a GC. They're nice yeah. But if you know the application very well then memory management isn't too big a deal.
GC isn't required to be safe, and it doesn't guarantee safety, but it does makes safety a whole lot more likely.
Boehm is the best garbage collector given its constraints, but that doesn't make it a good garbage collector overall, or even one worth using. I agree that good GC requires language support; what I disagree with is the attitude that people should use C anyway and forget GC because Boehm isn't good.
> But if you know the application very well then memory management isn't too big a deal.
Agreed.
A related case is with Objective-C's memory management scheme which isn't a full GC, but lets you scope your memory allocations. It gets you a level of control that is somewhere between a GC and the kind that boost::shared_ptr does ... neither having the "wait for the trashman" problem that GC brings, nor overdoing the reference count touching like boost can get you into.
> A precise generational collector would perform far better but wouldn't be so easy to drop into a C codebase.
It's that last part that's key. Without language support at even the basic level, you won't get much better.
As for this "precise generational collector", I doubt it. Like everything, saying you need a GC all the time to be safe is just more boogey man fear mongering. You don't need a GC. They're nice yeah. But if you know the application very well then memory management isn't too big a deal.