[cc's pruned] > static void > burn_stack (int bytes) > { > char buf[64]; > > memset (buf, 0, sizeof buf); > bytes -= sizeof buf; > if (bytes > 0) > burn_stack (bytes); > }
This may also not quite do what you think: 1) burn_stack() may reasonably be made tail-recursive by a sufficiently agressive compiler, if the memset is inlined and is then recognized as a bunch of dead stores. 2) even if it doesn't get tail-call treatment, some ABI's require largeish alignment for stack frames or define a fixed component to the stack frame and then don't fill in the unused stack slots; either of these may leave a good size chunk of the stack unwritten. - Bill --------------------------------------------------------------------- The Cryptography Mailing List Unsubscribe by sending "unsubscribe cryptography" to [EMAIL PROTECTED]