-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework SymbolTableCache::str2sym member
So far our symbol name to symbol index inside the SymbolTableCache type was just referencing memory mapped strings directly. That works well, but it breaks once we introduce the option of not using a memory mapping but reading sections from a file using "regular" file I/O -- which is something that we require as a "fallback" with upcoming changes. Basically, if SymbolTableCache::strs is heap allocated then str2sym can't easily reference data from it, as that would be self-referential. To work around this issue, instead of storing references inside the str2sym table, we work with indexes. As a perhaps positive side effect of making this change, we also opted for pushing the string validation further out to the point where we actually need the Unicode string. This could, conceivably, help in cases where, say, a symbol table contains corrupt or otherwise garbled symbol names. Signed-off-by: Daniel Müller <deso@posteo.net>
- Loading branch information
Showing
1 changed file
with
66 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters