From mboxrd@z Thu Jan 1 00:00:00 1970 From: Morten Welinder To: davem@redhat.com Cc: gcc@gcc.gnu.org Subject: Re: Faster compilation speed Date: Mon, 12 Aug 2002 14:10:00 -0000 Message-id: <20020812210941.22418.qmail@tyr.diku.dk> X-SW-Source: 2002-08/msg00686.html Hi there, > 5) If you are still bored at this point, add the machinery to use the > RTX walking of the current garbage collector to verify the > reference counts. This will basically be required in order to > make and sufficiently correctness check a final implementation. There are other ways. * Excess unrefs and missing refs will show whereever the ref count goes below zero. * Excess refs and missing unrefs will show as leaks. * An evil combination might not show. (Tough.) Take a look at Gnumeric's chunk allocator (in src/gutils.c) which has an almost-for-free leak walker, see gnm_mem_chunk_foreach_leak, which is always turned on for gnumeric. (It's linear-time in the number of leaks.) If we leak an expression tree, we will be told. And we will be told what that expression was. Same thing for all the other structured objects we have in Gnumeric. ftp://ftp.gnome.org/pub/GNOME/pre-gnome2/sources/gnumeric/gnumeric-1.1.6.tar.gz (or 1.1.7 if you wait half an hour) The hardest part probably is that ref-counting requires more discipline than a lot of people can muster. Morten