simpler public calling interface for computing footprint

This commit is contained in:
Vern Paxson 2022-05-02 15:08:37 -07:00
parent 15123b6768
commit 7fd94f82a8
2 changed files with 13 additions and 4 deletions

View file

@ -127,6 +127,17 @@ public:
* The number is not meant to be precise, but rather comparable:
* larger footprint correlates with more memory consumption.
*
* @return The total footprint.
*/
unsigned int Footprint() const
{
std::set<const RecordVal*> analyzed_records;
return Footprint(&analyzed_records);
}
/**
* Internal function for computing a Val's "footprint".
*
* @param analyzed_records A pointer to a set used to track which
* records have been analyzed to date, used to prevent infinite
* recursion. The set should be empty (but not nil) on the first call.