[EMAIL PROTECTED] wrote:
It makes the code smaller and faster to set a flag when malloc fails, rather than trying to test for the failure all the way back up the stack.
If all you need to store is a boolean flag (or in general, a 32-bit value that is not a pointer to allocated memory) you can just store it directly in the TLS slot. Since you haven't allocated anything, you don't need any per-thread cleanup.
Igor Tandetnik