Join Nostr
2025-12-31 00:05:42 UTC

Björkus "No time_t to Die" Dorkus on Nostr: In a "surprise twist" that everyone with a working brain expected, it turns out ...

In a "surprise twist" that everyone with a working brain expected, it turns out shuttling variables through globals or statics is far, far more expensive than using the stack and/or registers with normal arguments and an implicit backing object. In a further upset, it turns out that Lambdas embody that pretty strongly, and the 2nd best thing is a strongly typed closure plus a thin Wide Function Pointer type.

Crazy how that works.

https://thephd.dev/the-cost-of-a-closure-in-c-c2y-followup