开发者

How can I differentiate "stack" memory from dynamic memory in Fortran?

开发者 https://www.devze.com 2023-03-13 22:34 出处:网络
Say I have a routine foo() that calls a routine bar(argument). Argument can either be a declaration \"on the stack\" (draw开发者_如何学Going a parallel to C) or it can be dynamically allocated. How ca

Say I have a routine foo() that calls a routine bar(argument). Argument can either be a declaration "on the stack" (draw开发者_如何学Going a parallel to C) or it can be dynamically allocated. How can I inquire inside bar() if argument memory was allocated with the first or the second method ?


The best thing would be to see the assembly code. Arrays will be typically on the heap and local scalars on the stack, but there is no standard fortran inquire function for that and your code should not depend on these details.

0

精彩评论

暂无评论...
验证码 换一张
取 消