| needstack \- check for execution stack overflow |
| Stack overflow in the thread library leads to bugs that are |
| The Plan 9 libraries are careful about not allocating |
| large structures on the stack, so typically four or eight kilobytes is plenty of stack |
| Other libraries are not always as careful. |
| indicates to the thread library that an external routine is about |
| to be called that will require |
| If there is not enough space left on the stack, |
| the thread library prints an error and terminates |
| can be used to check whether the stack is |
| so that library functions used in threaded and non-threaded contexts |
| should be thought of as a comment checked at run time, |
| The X Window library implementation of |
| allocates some very large buffers on the stack, so |
| .B \*9/src/libdraw/x11-itrans.c |
| If a thread (in this case, the keyboard-reading thread used |
| does not allocate a large enough stack, the problem is diagnosed |
| immediately rather than left to corrupt memory. |
| .B \*9/src/lib9/needstack.c |