This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Reduce GC overhead of the C++ lexer buffer
On Mon, 19 Jun 2006, Mark Mitchell wrote:
> Richard Guenther wrote:
>
> > CP_LEXER_BUFFER_SIZE does not need to be power-of-two, but sizeof (struct
> > cp_token) * CP_LEXER_BUFFER_SIZE should be close to (slightly below or
> > equal) power-of-two, as this is the amount of memory GGC_NEWVEC will
> > allocate. So, ((256 * 1024) / sizeof (struct cp_token)) * sizeof (struct
> > cp_token) will be at most sizeof (struct cp_token) - 1 less than 256 *
> > 1024 - and sizeof (struct cp_token) - 1 will be the new GC overhead here.
>
> Thanks; I had missed that we were using GCC_NEWVEC here. I appreciate
> your patience.
Note that the initial buffer size is 256kB, not 8kB as you assumed. It
was 200kB before the patch on a 32bit host and 320kB on a 64bit host.
Just to give us the possibility to lower this - though I guess C++
translation units are usually larger than 10000 tokens.
Richard.
--
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs