Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
It seems Relations should be not taken into account because they don't reference a backing storage.
Only SymStorage and RefsStorage are passed to the respective index in the Payload argument.
return std::make_unique<MemIndex>( llvm::make_pointee_range(AllSymbols), std::move(AllRefs), std::move(AllRelations), std::make_tuple(std::move(SymbolSlabs), std::move(RefSlabs), <<<< std::move(RefsStorage), std::move(SymsStorage)), <<<< StorageSize);
Also, there is a comment regarding Rels slab in Dex.cpp:
std::unique_ptr<SymbolIndex> Dex::build(SymbolSlab Symbols, RefSlab Refs, RelationSlab Rels) { auto Size = Symbols.bytes() + Refs.bytes(); // There is no need to include "Rels" in Data because the relations are self- <<<<< // contained, without references into a backing store. <<<<< auto Data = std::make_pair(std::move(Symbols), std::move(Refs)); return std::make_unique<Dex>(Data.first, Data.second, Rels, std::move(Data), Size); }
MemIndex also uses only Symbols and Refs slabs to compute backing storage size.
Comment Actions
Thanks, you're right. There's no "payload" memory here, and MemIndex::estimateMemoryUsage should already be accounting for all the memory used.
(Sorry, it's been a while since I looked at this code)