Am 9/25/2024 um 12:02 PM schrieb Boqun Feng:
Hi Jonas, Of course, if we are really worried about compilers being too "smart"
Ah, I see you know me better and better...
Yes, but then a simple compiler barrier between the comparison and returning ptr would also do the trick, right? And maybe easier on the eyes.we can always do the comparison in asm code, then compilers don't know anything of the equality between 'ptr' and 'head - head_offset'.
Have fun, jonas