Re: Overloading OPERATOR(+): my usage causing memory leaks.

steve wrote:


Some of these memory leaks with gfortran are well-known. Paul Thomas
had developed a -fcheck=memleak (or some such named option) to help
track down leaks in not only user code but also gfortran. Sadly, that
was lightly tested and withered in the mailing list. There are plans
revamp the internal representation in array descriptors. It is hoped
some (if not all) of these leaks will be caught at that time.

Hi again Steve,

No worries. I'm treating this as more of a "don't try to fool the compiler" type of lesson
(which I should have learned long ago but there ya go :o). Granted the leaks shouldn't
occur if I write my own assignment function, but letting the compiler do what it should be
doing anyway was a quick workaround. And I learned something new and important - so there
are no complaints on my end.

Would it be useful if I tacked my (not so small) test case on to the relevant bugzilla
report (I assume there is one)?




Relevant Pages

  • Re: memory leak in fortran?
    ... $ gfortran test_memleak.f90 ... $ valgrind a.out ... integer, target:: a ... particular about memory leaks. ...
  • Re: pointer components and memory leaks
    ... But whatis the rhs of the assignment? ... procedure to make that work without leaks. ... I have made this approach work with every compiler I've ... G.W. Stewart, Memory leaks in derived types revisited, ACM Fortran ...
  • Re: Help me fix a small unit?
    ... > you turned them on in your project options, ... Delphi's equivalent compiler directive is $STACKFRAMES. ... lists three alleged leaks, which I'm presently taking with a grain of salt. ... procedure TForm1.Button1Click(Sender: TObject); ...
  • Re: A Tale of Two Memory Managers (long)
    ... If nobody cared how long a .NET app took to load, sure, the JIT compiler ... > memory managers. ... slowness of .NET code hasn't been caused by garbage collection but by ... memory leaks at all. ...
  • Re: Smart Pointers: Is there something similar to smart pointers in C?
    ... collected, at the proper times, as the case may be. ... lcc-win32 uses Boehm's garbage collector, ... leaks, ... the compiler can simply always use alloca(allocate ...