3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-11-22 13:41:27 +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 Emil J. Tywoniak
parent 8c2984dc5f
commit 578d658871
5 changed files with 22 additions and 0 deletions

View file

@ -579,6 +579,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
@ -590,6 +592,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_);