[go: up one dir, main page]

|
|
Log in / Subscribe / Register

Losing the magic

Losing the magic

Posted Dec 5, 2022 22:06 UTC (Mon) by iabervon (subscriber, #722)
In reply to: Losing the magic by Sesse
Parent article: Losing the magic

I think the original was (0 ? (*fn)(arg) : store_callback(fn, arg)), and using enough optimization that the direct call won't be generated. Once people demonstrated the benefit and possibility of doing this sort of testing, a later innovation was the sizeof trick to make the code really explicitly execute as "discard a small integer", which will be nothing following even unoptimized code generation (since even minimal register allocation will just discard the code).


to post comments


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds