Quantcast
Channel: Recent posts
Viewing all articles
Browse latest Browse all 27

Memory leaks and segmentation fault when allocating unlimited polymorphic variable

$
0
0

I have attached a small program with relevant comments that demonstrate the issues. This happens with version 12.1 on opensuse 11.4. Here is a small summary of what I am seeing:

The following works in the main program, but it fails if I send vct to a subroutine and use the same allocate statement.

TYPE(Vector) :: vct
CLASS(*) :: v

ALLOCATE(v, SOURCE=vct)
DEALLOCATE(v)

However, it is possible to do

ALLOCATE(Vector::v)
SELECT TYPE (v)
TYPE IS (Vector)
v = vct
END SELECT
DEALLOCATE(v)

But, this causes a memory leak.


Viewing all articles
Browse latest Browse all 27

Trending Articles



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