3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-11-06 06:16:04 +00:00

Add timing stats for IdString garbage collection

This commit is contained in:
Robert O'Callahan 2025-10-17 12:15:53 +13:00 committed by Robert O'Callahan
parent cd47727c8b
commit 7371388e1d
5 changed files with 22 additions and 0 deletions

View file

@ -578,6 +578,8 @@ struct RTLIL::OwningIdString : public RTLIL::IdString {
// Collect all non-owning references.
static void collect_garbage();
static int64_t garbage_collection_ns() { return gc_ns; }
static int garbage_collection_count() { return gc_count; }
// Used by the ID() macro to create an IdString with no destructor whose string will
// never be released. If ID() creates a closure-static `OwningIdString` then
@ -589,6 +591,9 @@ struct RTLIL::OwningIdString : public RTLIL::IdString {
return result;
}
private:
static int64_t gc_ns;
static int gc_count;
void get_reference()
{
get_reference(index_);