This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Reduce GC overhead of the C++ lexer buffer


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.

The patch is OK.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]