Use this to compute the amount of memory committed for the current thread's stack:
function CommittedStackSize: Cardinal;
asm
mov eax,[fs:$4] // base of the stack, from the Thread Environment Block (TEB)
mov edx,[fs:$8] // address of lowest committed stack page
// this gets lower as you use more stack
sub eax,edx
end;
Another idea I don't have.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…