[PATCH] OnDiskHashTable: Make the iterable version separate

Justin Bogner mail at justinbogner.com
Tue Apr 8 13:15:25 PDT 2014


Currently the on disk hash table's key_iterator and data_iterator make
the assumption that the table data starts exactly four bytes after the
base of the table. This happens to be true for all of the tables we
currently iterate over, but not for all of the OnDiskHashTables we
currently use. For example, key_ and data_iterator would iterate over
meaningless data if they were used on the hash tables in PTHLexer.
    
We can make the API safer by breaking this into two types. One doesn't
have the iterators, and the other must be told where the payload starts.

The name I've chosen, OnDiskIterableHashTable, is a bit wordy, but I
couldn't think of anything better.

Does this look okay to commit?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: iterable-hash-table.patch
Type: text/x-patch
Size: 11507 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140408/748e757d/attachment.bin>


More information about the cfe-commits mailing list