/// \brief Deallocate memory in the preprocessing record.
void Deallocate(void *Ptr) { }
-
- size_t getTotalMemory() const {
- return BumpAlloc.getTotalMemory();
- }
-
+
+ size_t getTotalMemory() const;
+
// Iteration over the preprocessed entities.
class iterator {
PreprocessingRecord *Self;
File, SourceRange(HashLoc, EndLoc));
PreprocessedEntities.push_back(ID);
}
+
+size_t PreprocessingRecord::getTotalMemory() const {
+ return BumpAlloc.getTotalMemory()
+ + MacroDefinitions.getMemorySize()
+ + PreprocessedEntities.capacity()
+ + LoadedPreprocessedEntities.capacity();
+}
}
size_t Preprocessor::getTotalMemory() const {
- return BP.getTotalMemory() + MacroExpandedTokens.capacity()*sizeof(Token);
+ return BP.getTotalMemory()
+ + MacroExpandedTokens.capacity()
+ + Predefines.capacity() /* Predefines buffer. */
+ + Macros.getMemorySize()
+ + PragmaPushMacroInfo.getMemorySize()
+ + PoisonReasons.getMemorySize()
+ + CommentHandlers.capacity();
}
Preprocessor::macro_iterator