开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜