Message on thread Stack Usage?

Re: Stack Usage? (2018-07-08 09:31, SHIRAISHI Kazuo, #81592)

I found the stack size change by 160 bytes on Win64.

You can modify the Pascal source codes in the code view window.

Add the following codes just above the line (* Main Program *)

var StackPrev:NativeInt=0;
function StackDiff(var StackPrev:NativeInt):double;
var
StackCur:NativeInt;
begin
asm
mov StackCur,rsp
end;
result:=StackCur-StackPrev;
StackPrev:=StackCur;
end;

And then add the following code into the appropriate position where you like.

console.PRINT([],rsNone, false ,[StackDiff(StackPrev), TNewLine.create ]);

For example,

function _0ACKERMANN(_M:double; _N:double):double; overload; forward;
function _0ACKERMANN(_M:double; _N:double):double; overload;
begin
{$MAXFPUREGISTERS 0}
console.PRINT([],rsNone, false ,[StackDiff(StackPrev), TNewLine.create ]);
result:=0;









Reply to #81588

Reply to #81592×

You are not logged in. To discriminate your posts from the rest, you need to pick a nickname. (The uniqueness of nickname is not reserved. It is possible that someone else could use the exactly same nickname. If you want assurance of your identity, you are recommended to login before posting.) Login

Thread

Stack Usage? (2018-07-06 21:53, toml_12953, #81579)
Re: Stack Usage? (2018-07-07 14:31, SHIRAISHI Kazuo, #81583)
Re: Stack Usage? (2018-07-07 17:25, SHIRAISHI Kazuo, #81585)
Re: Stack Usage? (2018-07-07 18:47, toml12953, #81588)
Re: Stack Usage? (2018-07-08 09:31, SHIRAISHI Kazuo, #81592)
Re: Stack Usage? (2018-07-14 10:30, Shiraishi Kazuo, #81601)
Re: Stack Usage? (2018-07-07 17:54, SHIRAISHI Kazuo, #81587)