Note : this comment applies to FTN95 /64.
I tried to write a simple program to identify which memory pages were Stack, Heap or Module data. Unfortunately I did not find the rules for when automatic arrays are placed on the heap, rather than the stack. I should not complain, as this change is a good change. I may post the program example when I have these rules better understood.
Can someone advise where this is documented ? I note Version - 8.20 states '* 64 bit FTN95 now stores large static arrays in the same way as automatic arrays' but I can't find the changes for automatic. What is a 'large static array' ?
The stack size can be changed in slink64 with
stack_size <hex number> or,
stack <dec mbytes>
I think the 'virtual stack' is now 4GB and I assume virtual stack is the stack?
(it would be good if the stack size could be reported, perhaps in program.map)
In recent usage for 64-bit programs, I have been using a very large STACK (512Mbytes). What I am finding is this provides a large reserved address space in the 64-bit virtual memory map, but does not require any physical memory or commited memory until that stack space is used. It neither affects the available physical memory or the virtual paged memory, so runs on my PC with limited installed memory or 'small' pagefile.sys capacity.
I also apply this to multi-thread usage where 12 threads can imply 6 GBytes of mapped out memory addresses, with no affect on memory or paging resources. Ifort does a similar thing with a virtual heap when allocation large arrays at very large addresses. This is yet another way of minimising any Stack issues, so defining a 4GB stack might be a good default.
The heap address can also go anywhere (although the user does not control it) It could, for example, start at address 100GB, and Win64 OS would just ignore the unused addresses below this heap. It is all virtual until memory pages are allocated, but only for what is being used. It is a good thing to understand for all of us who struggled with 32-bit address management.
The main thing to remember is that /64 now offers a much better approach to stack and heap sizing than /32.