Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Stack vs. heap memory

Intel_C_Intel
Employee
587 Views
Can CVF use ALLOCATE to get memory from the stack instead of the heap? If not, is there any other way to get stack memory for a structure?

Stack memory would be very efficient for some temporary structures that we would like to create in a subroutine, and pass to a "C" routine where it will be copied. The allocated memory can be removed automatically from the stack when returning from the original Fortran subroutine.

Eddie
0 Kudos
2 Replies
Steven_L_Intel1
Employee
587 Views
ALLOCATE is for heap only. See the manual for "automatic arrays" - this is what you want.

Steve
0 Kudos
Intel_C_Intel
Employee
587 Views
Thanks Steve!
Eddie
0 Kudos
Reply