On 2/12/26 6:01 PM, Nicklas SB Karlsson wrote:
What would the wrap of the heratbeat counter do?
It could cause the difference calculation of two temporally separated
values of the heartbeat counter to result in the wrong result (a
negative difference instead of a positive one).
If done right result should always be positive if it is an increasing provided
counter is checked more often than ~24½
days.
Calculations are probably best tested write a small "hello world" type program
there a few calculations around the wrap
point is calculated.
The tricky part is that the source heartbeat variable is unsigned 32
bit. A difference result is signed. Additionally, calculations may or
may not be done in 64 bit and that depends compiler configuration and
how optimizations work out for the particular case, even though
calculations are normally done "in native size". What that exactly means
has proven to be a difficult proposition with modern compilers.
But discussing this makes me realize... I'll just make a fix that'll
work ;-)
--
Greetings Bertho
(disclaimers are disclaimed)
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers