This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH: Do not allocate conversions in GC-memory
- From: Geoff Keating <geoffk at geoffk dot org>
- To: mark at codesourcery dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 13 Feb 2004 11:10:05 -0800
- Subject: Re: C++ PATCH: Do not allocate conversions in GC-memory
- References: <200402130718.i1D7IlDX027826@sirius.codesourcery.com>
Mark Mitchell <mark@codesourcery.com> writes:
> This patch uses an obstack, rather than GC-able memory, to allocate
> the temporary storage we need while figuring out how to perform
> conversions.
>
> On one test case we have, this reduced the number of calls to
> make_node from 3 million to 2.1 million and the number of calls to
> ggc_set_mark from 117 million to 2.9 million. I saw an improvement of
> about 1.5% in compilation time, but I wouldn't be surprised if it
> would be better than that on a machine with less RAM. (On the machine
> we used the memory allocated didn't exceed physical RAM at all.)
>
> Anyhow, tested on i686-pc-linux-gnu and applied on the mainline.
Hi Mark,
> + /* Free all the conversions we allocated. */
> + obstack_free (&conversion_obstack, p);
Could you add some ENABLE_CHECKING code to make sure that all the
memory in conversion_obstack gets zeroed (or something) in each place
where it's freed? Otherwise there's no check that a pointer does not
escape.
How does this reduce the number of calls to ggc_set_mark? Is it
possible that you're now storing pointers to GCed memory in non-GCed
memory, or is this entirely due to fewer ggc_collect runs?
Did you run a bootstrap with gcac checking? I think that would be a
good idea.
--
- Geoffrey Keating <geoffk@geoffk.org>