3 ms·
"every time you call a function, its vars get allocated on the stack." That's 'may get allocated'. Also, even if you compile with -OnegativeInfinity, your 'an
by Someone 13y ago
"every time you call a function, its vars get allocated on the stack."
That's 'may get allocated'.
Also, even if you compile with -OnegativeInfinity, your 'another fun way' won't do what you think it does on architectures that store return addresses and locals on the same stack (= most CPUs that mortals will program) or that grow the stack 'up' (rare)
- IgorPartola 13y agoInteresting. I can't find any reference to negativeInfinity and what that would do. Can you explain further? Also, like I said, that's a "fun" way, as in a giant hack not meant to ever be written outside of just messing around.
- Someone 13y agoThat -OnegativeInfinity is a pun. With many compiler chains, -O0 (hyphen-oh-zero) does 'no' optimization, -O1 does a bit more, -O2 some more, -O3 even more. That 'no' is on quotes because there is no such thing as 'no optimization'. For example, given enough locals, a compiler must do register allocation. The hypothetical -OnegativeInfinity would truly do no optimization.