Platforms to show: All Mac Windows Linux Cross-Platform

FAQ.How to get the current free stack space?

Answer: You can something like the code below:
Example
Sub ShowStackSize()
dim threadid as Integer
dim size as Integer

declare function GetCurrentThread lib "Carbon" (byref threadid as Integer) as short
declare function ThreadCurrentStackSpace lib "Carbon" (threadid as Integer, byref size as Integer) as short

if GetCurrentThread(threadid)=0 then
if 0=ThreadCurrentStackSpace(threadid,size) then
MsgBox str(size)
end if
end if
End Sub

For Mac OS 9, use "ThreadLib" instead of "CarbonLib". You can use #if if you like for that.


The biggest plugin in space...