- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Before the variables are all defined with a fixed length. I started implementing allocatable variables in my code and learned that Fortran needs explicit deallocation. Then it prompt me to wonder what happens to the allocated memory when the code crashes? If I have a code that crashes often, does that mean there would be a lot of memory leaks until the computer restarts and resets the memory?
링크가 복사됨
1 응답
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
No - all memory allocated gets freed when the executable exits, no matter how. Also, Fortran doesn't "need" explicit deallocation. Local, non-SAVEd allocatable variables are automatically deallocated when a routine exits. (This is not true for pointers.)
