string pools, final version (committed)

Mark Mitchell mark@codesourcery.com
Sat Nov 18 16:27:00 GMT 2000


>>>>> "Zack" == Zack Weinberg <zackw@Stanford.EDU> writes:

    Zack> On Sat, Nov 18, 2000 at 03:26:21PM -0800, Mark Mitchell
    Zack> wrote:
    >> >>>>> "Zack" == Zack Weinberg <zackw@Stanford.EDU> writes:
    >> 
    Zack> No, all identifiers go in the hash table.

    Zack> ...
    >> Why do non-macros/pragmas/etc. need to get hash table entries?

    Zack> cpplib's "hash table" is really a string pool.  Most
    Zack> macro-related data is in a separately allocated structure.

OK -- but then that reduces to my earlier suggestion! 

Since, in general, all CPP identifiers are also going to be C/C++
identifiers, you can share the same stringpool.  The CPP hash table
then only has to contain the macro-related stuff -- which is already
separate.

The point is that you don't need to store CPP-related data in the
stringpool, which was your original concern.  You just replace CPPs
stringpool with the new stringpool (saving vast amounts of memory).
That stringpool still has its IDENTIFIER_NODE slot, but no extra
slots.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com


More information about the Gcc-patches mailing list