Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

Memory used by extended types

$
0
0
Hello.  

I have found something weird in the memory used when a derived type extends another but I do not know if there is an explanation for this or if it is just a bug.

The simplified program below works as I would expect only when the default initialization of the Parent type (N = 0) is commented. When I uncomment the initialization the memory reported by the Windows Task Manager is twice the expected one and after the deallocation not all the memory seems to be released (at the pause statement before the program end).  
program Test
  type Parent
    integer :: N != 0
  end type
  type, extends(Parent) :: Extended
    real(8) :: M(2000,2000)
  end type
  type(Extended), pointer:: Var
  allocate(Var)
  Var%M = 0d0
  pause
  deallocate(Var)
  pause
end program Test
 

Thanks in advance.

 


Viewing all articles
Browse latest Browse all 3270

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>