You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some Discussion History:
From Yaming Kuang:
See code below, for debug build, if someone is updating counter that doesn't exist, it should be able to throw runtime assert error, line: 263.
For release build, it won't, because see line:275, there is no check, it is just pretending it got valid index (this index could be anything) and then try to increase it.
From Yaming Kuang
Still it seems only able to do it at runtime, not compile time, even we apply the same logic check from line: 263 ~ 267 for release build which is going to hurt the runtime performance, as metrics updating is almost everywhere.
Maybe it is worth for someone to spend sometime to see how this can work even the name doesn't exist in that sisl::type
Brian Szmyd
Feb 12th at 10:14 AM
I take that back @Yaming Kuang
getInstance() will always return a MetricGroup I think regardless of it being registered:
and m_Index is set to size_t::max which should work if it’s never been set. Since this is not compile time set we can’t check it at compile time.
I think it may be possible to move the instantiation of the class to the REGISTER macro so if someone doesn’t call that we’ll get a linker error…similar to how logging will cause a link failure if you don’t call SISL_LOGGING_DEF(module) somewhere…
Right now updating a counter that is not defined will cause memory corruption in release mode.
Slack Discuss: https://ebay-eng.slack.com/archives/C07JWRZGG4D/p1740761894559139
Some Discussion History:
From Yaming Kuang:
See code below, for debug build, if someone is updating counter that doesn't exist, it should be able to throw runtime assert error, line: 263.
For release build, it won't, because see line:275, there is no check, it is just pretending it got valid index (this index could be anything) and then try to increase it.
The text was updated successfully, but these errors were encountered: