[Gc] Patches for C++ to support throw() declarations, and that throw std::bad_alloc on OOM.

Boehm, Hans hans.boehm at hp.com
Mon Nov 9 22:28:27 PST 2009


 
> Slightly more controversially:
> 
> *  The standard operator new that gc_cpp.h and gc_cpp.cc 
> provides allocates memory with GC_MALLOC() instead of 
> GC_MALLOC_UNCOLLECTABLE().
> 
Thanks.

Unfortunately, I'm still concerned about this.  The problem is that this significantly changes the behavior of an interface that's been around for a while.  The original idea behind this interface was to use garbage-colelcted allocation only where it was requested.  Right or wrong, this would change that design decision retroactively.

I guess out-of-memory handling doesn't change visibly unless you call gc_cpp_init()?  Thus the behavior is backward compatible?

Can this be solved by just providing an alternate gc_cpp.cc to get the alternate behavior?

Hans


More information about the Gc mailing list