mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 10:03:44 +02:00
Reduce size of FileLine
Multiple tricks to reduce the size of class FileLine from 72 to 40 bytes: - Reduce file name index from 32 to 16 bits. This still allows 64K unique input files, which is hopefully enough. - Intern message/warning enable bitset and use a 16-bit index, again allowing 64K unique sets which is hopefully enough. - Put the m_waive flag into the sign bit of one of the line numbers. - Use explicit reference counting to avoid overhead of shared_ptr. Added assertions to ensure interned data fits within it's index space. This saves ~5-10% peak memory consumption at no measurable run-time cost on various designs.
This commit is contained in:
+1
-1
@@ -101,7 +101,7 @@ public:
|
||||
for (V3HierarchicalBlockOption::ParamStrMap::const_iterator pIt = params.begin();
|
||||
pIt != params.end(); ++pIt) {
|
||||
std::unique_ptr<AstConst> constp{AstConst::parseParamLiteral(
|
||||
new FileLine(FileLine::EmptySecret()), pIt->second)};
|
||||
new FileLine{FileLine::builtInFilename()}, pIt->second)};
|
||||
UASSERT(constp, pIt->second << " is not a valid parameter literal");
|
||||
const bool inserted = consts.emplace(pIt->first, std::move(constp)).second;
|
||||
UASSERT(inserted, pIt->first << " is already added");
|
||||
|
||||
Reference in New Issue
Block a user