Re: Fortran and .NET (C#)
- From: Richard E Maine <nospam@xxxxxxxxxxxxx>
- Date: Tue, 27 Sep 2005 13:55:24 -0700
In article <Vvh_e.24109$nq.10607@lakeread05>,
"apm" <Contributor@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> "Richard E Maine" <nospam@xxxxxxxxxxxxx> wrote in message
> news:nospam-0B071C.12183427092005@xxxxxxxxxxxxxxxxxxxxx
> > pointers (both in C and in Fortran)
> > are subject to memory leak problems. In contrast, you can't generate a
> > memory leak with a Fortran array that isn't a pointer, no matter how
> > hard you try.
>
> Both Fortran pointers and allocatable arrays allow dynamic allocation. It is
> the dynamic allocation that can lead to memory leaks.
That is an overly broad generalization which is false. You are
attempting to generalize your previous experience with a particular
style of dynamic memory allocation. The generalization doesn't hold.
Let me repeat for the second time (at least) in this thread, and not
counting many times in previous thready. You *CANNOT* leak memory
because of a user error with Fortran allocatable arrays. That is an
intentional part of the design of Fortran allocatables. It is so much a
part of the design, that if you managed to find a way to do it, I am
confident that it would be regarded as a bug in the standard and a fix
would be published. In the many times I have explained this, not once
has anyone come up with a code sample to contradict it.
Nor, I might add, can you leak memory because of a user error with
Fortran's dynamically allocated automatic arrays.
Memory leaks are not fundamental to dynamic allocation. They are a
"feature" of using pointers (or other similar things) for dynamic
allocation.
--
Richard Maine | Good judgment comes from experience;
email: my first.last at org.domain | experience comes from bad judgment.
org: nasa, domain: gov | -- Mark Twain
.
- Follow-Ups:
- Re: Fortran and .NET (C#)
- From: Rich Townsend
- Re: Fortran and .NET (C#)
- From: Brooks Moses
- Re: Fortran and .NET (C#)
- References:
- Fortran and .NET (C#)
- From: apm
- Re: Fortran and .NET (C#)
- From: Richard Maine
- Re: Fortran and .NET (C#)
- From: apm
- Re: Fortran and .NET (C#)
- From: Richard E Maine
- Re: Fortran and .NET (C#)
- From: apm
- Fortran and .NET (C#)
- Prev by Date: Re: declaring array arguments in subroutines
- Next by Date: Re: Fortran and .NET (C#)
- Previous by thread: Re: Fortran and .NET (C#)
- Next by thread: Re: Fortran and .NET (C#)
- Index(es):
Relevant Pages
|
|