- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
CVF Version 6.6c
I have a program that dynamically allocates a user defined data structure that itself contains allocatable components, some of which are also user defined. When the program attempts to allocate the data structure and it is too large for the available memory the STAT status correctly flags an error but there appears to be no memory available for the program to continue. It seems that the memory is allocated until there is none left butthen is not released upon failure thus causing the program to hang. Is this behaviour correct? AlsoI'm not sure whether thisapplies tosimpler allocatable data structures or standard FORTRAN data types.
To avoid this I would have to somehow calculate the size of the proposed data structure and then obtain the amount of available memory before trying to allocate.
I've also noticed that if an allocation fails any subsequent
if(allocated(array)) deallocate(array)
statementswill crash the program.
Any advice on these metterswould be appreciated.
링크가 복사됨
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
That said, CVF 6.6C was left with many bugs in its support for allocatable arrays. Some of these bugs might cause the behavior you note.