Check stack for a overrun.
- Parameters
-
thd | Thread handler. |
margin | Minimal acceptable unused space in the stack. |
buf | See a note below. |
- Returns
- false if success, true if error (reported).
- Note
- Note: The 'buf' parameter is necessary, and we must have code which uses it.
- Some of the fix_fields functions have a "dummy" buffer large enough for the corresponding execution. (Thus we only have to check in fix_fields.)
- Passing the buffer to check_stack_overrun() prevents the compiler from removing it.
- For -flto builds, the dummy buffer may be optimized away, so we need to write something into it.