[Gc] RE: A small patch to help with finalization cycles.
hans.boehm at hp.com
Tue Dec 15 16:00:15 PST 2009
I think this is potentially useful. But I think we want to keep the core of the collector compilable without a C++ compiler. We also don't want to apply your approach by default, since I'm not sure whether it may, for example, segfault with a different compiler.
For both reasons, I think it's much better to supply the function to compute the type id via an optional callback. GC_register_type_fn is already there, and I
think it would be better to use it. That mechanism should probably be moved
out of dbg_mlc.c, into say misc.c, so that dbg_mlc.c doesn't always need to get
It would be better if we could just use GC_print_heap_obj directly. But that doesn't get properly filtered through GC_warn_proc, and thus seems hard.
> -----Original Message-----
> From: gc-bounces at napali.hpl.hp.com
> [mailto:gc-bounces at napali.hpl.hp.com] On Behalf Of Talbot, George
> Sent: Tuesday, December 15, 2009 1:52 PM
> To: gc at linux.hpl.hp.com
> Subject: [Gc] A small patch to help with finalization cycles.
> Hi folks,
> I've attached a small patch that I've only tested on Linux
> with GCC that prints C++ type information for objects with
> virtual functions using RTTI when printing a finalization
> cycle warning. Though it's a bit of a hack, it can be
> massively useful finding said cycles.
> Let me know if this is useful, and if there are any changes
> you need me to make for it to go in if so.
> George T. Talbot
> <gtalbot at locuspharma.com>
More information about the Gc