This is the mail archive of the
mailing list for the GCC project.
Re: PATCH: better cpplex.c patch
- To: Greg McGary <greg at mcgary dot org>
- Subject: Re: PATCH: better cpplex.c patch
- From: Neil Booth <NeilB at earthling dot net>
- Date: Mon, 4 Sep 2000 14:40:00 +0100
- Cc: law at cygnus dot com, zack at wolery dot cumb dot org, gcc-patches at gcc dot gnu dot org
- References: <11228.967739156@upchuck> <email@example.com>
Greg McGary wrote:-
> Zack, what's the rationale for tokenlists allocating from a single
> buffer? Does this save significant time because you can free a token
> list all at once? Is the savings still enough when you account for
> the cost of realloc'ing and relocating token pointers?
The rationale is that the token list is re-used for each (logical)
line of the input file. In 90% of cases I doubt the list ever gets
realloced, as it is fairly wide initially, and in the remaining 10% it
probably gets realloced no more than once or twice. So I do believe
it saves considerable time.
I intend to rework the lexer in the near future, and token lists with
attached buffers like this will probably go away.