-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Currently, we detect the overflow by checking if the latest counter is less than before:
let (c00, c01, c10, c11) = (
c00_u8.cast::<u16>(),
c01_u8.cast::<u16>(),
c10_u8.cast::<u16>(),
c11_u8.cast::<u16>(),
);
(c10 < c00)
|| (c11 < c01)
|| (c10 >= c00.overflow_add(2)
&& c11 >= c01.overflow_add(2)
&& c11 >= c00.overflow_add(3))
But if the relocation happens more than once, this method does not work.
One solution is to leverage the highest bit of the counter as a overflow flag. We can check and reset the flag in this method.
Metadata
Metadata
Assignees
Labels
No labels