This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/12850] memory consumption for heavy template instantiations tripled since 3.3
- From: "gdr at integrable-solutions dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Dec 2004 14:42:39 -0000
- Subject: [Bug c++/12850] memory consumption for heavy template instantiations tripled since 3.3
- References: <20031030234001.12850.jens.maurer@gmx.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From gdr at integrable-solutions dot net 2004-12-23 14:42 -------
Subject: Re: memory consumption for heavy template instantiations tripled since 3.3
"steven at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
[...]
| Maybe buffer should not be in GC memory at all? We know the
| exact live time of buffer, and as far as I can tell we never
| ggc_collect while it is live. According to the comments for
| cp_lexer, "Tokens are never added to the cp_lexer after it is
| created." So it may be cheaper to have the buffer xmalloced,
| and memcpy-ed to a buffer in GC space just before saving it
| in the new cp_lexer object.
Your analysis makes sense to me. I never quite understood the
addiction to GC-allocated memory throughout the compiler.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12850