- change the vector of relocs to std::list for ptr stability. (This field does not need to have fast access per index anyway. This should also make the remove/erase ops faster)
- when checking for entry existance use, .find() rather than the [] operator, which would actually create a new entry in the map.
Details
Details
- Reviewers
int3 - Group Reviewers
Restricted Project
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
I'm wary about using linked lists, especially for relocations ... could you measure the perf and memory usage difference from that? (Maybe each subsection has few enough relocations that it doesn't make a massive difference, but I'm still curious.)
If pointer stability is the main motivation, would std::deque work?
Comment Actions
The list change is def a bit more controversial. I would split out the map changes into its own diff :)
Also, could you elaborate on where you anticipate needing pointer stability?
Finally, if we really need a list, we might want to use LLVM's ilist for better locality.