Important: The information in this document is obsolete and should not be used for new development.
StackSpace
Use theStackSpace
function to find out how much space there is between the bottom of the stack and the top of the application heap.
FUNCTION StackSpace: LongInt;DESCRIPTION
TheStackSpace
function returns the current amount of stack space (in bytes) between the current stack pointer and the application heap at the instant of return from the trap.SPECIAL CONSIDERATIONS
Ordinarily, you determine the maximum amount of stack space you need before you ship your application. In general, therefore, this routine is useful only during debugging to determine how big to make the stack. However, if your application calls a recursive function that conceivably could call itself many times, that function should keep track of the stack space and take appropriate action if it becomes too low.ASSEMBLY-LANGUAGE INFORMATION
The registers on exit for StackSpace are
Registers on exit D0 Number of bytes between stack and heap RESULT CODES
noErr 0 No error