#pragma stack16 (OS/2)

The #pragma stack16 directive specifies the size of the stack to be allocated for calls to 16-bit routines.

>>---#---pragma--stack16--(------------)--><
                             \-size-/

The variable size is the size of the stack in bytes, and has a value between 512 and 65532. The size specified applies to any 16-bit functions called from that point until the end of the compilation unit, or until another #pragma stack16 directive is given.

The default value is 4096 bytes (4K). Note that the 16-bit stack is taken from the 32- bit stack allocated for the thread calling the 16-bit code. The 32-bit stack is therefore reduced by the amount you specify with #pragma stack16. Make sure your 32-bit stack is large enough for both your 32-bit and 16-bit code.

If the sum of the size, the number of bytes for parameters, and the number of local bytes in the function calling the 16-bit routine is greater than 65532, the actual stack size will be 65532 bytes less the number of parameter and local bytes. If the sum of the parameter bytes and local bytes alone is greater than 65532, no bytes will be allocated for calls to 16-bit routines.