[fpc-devel]fpc v1.1 02 jule 2002 memleaks

Sergey Korshunoff seyko at comail.ru
Wed Jul 10 03:13:07 CEST 2002


Hi!

There is a new memory leak:
===============
diff -urN FPC-MY-1.old/fpc/compiler/aasmbase.pas 
FPC-MY-1/fpc/compiler/aasmbase.pas
--- FPC-MY-1.old/fpc/compiler/aasmbase.pas	Sun Jul  7 15:34:23 2002
+++ FPC-MY-1/fpc/compiler/aasmbase.pas	Sun Jul  7 05:15:02 2002
@@ -430,6 +430,7 @@
       begin
         if assigned(Data) then
           Data.Free;
+        relocations.free;
       end;
-------------

And no one corrected two old memory leaks:
=====================
   Do not call .newobjectdata if MaybeNextList(hp)=false
   This remove a memory leak in smartlinking mode for:
           i386/cpu.pp, unix/errors.pp etc.

diff -urN FPC-MY-1.ORIG/fpc/compiler/assemble.pas 
FPC-MY-1/fpc/compiler/assemble.pas
--- FPC-MY-1.ORIG/fpc/compiler/assemble.pas	Thu Jul  4 06:39:01 2002
+++ FPC-MY-1/fpc/compiler/assemble.pas	Thu Jul  4 06:45:05 2002
@@ -1490,6 +1490,9 @@
               hp:=Tai(hp.next);
             end;
 
+           if not MaybeNextList(hp) then
+             break;
+
            { start next objectfile }
            NextSmartName(place);
            objectdata:=objectoutput.newobjectdata(Objfile);
@@ -1498,8 +1501,6 @@
            if starTSec=sec_none then
              starTSec:=sec_code;
 
-           if not MaybeNextList(hp) then
-             break;
          end;
       end;
 

------------------------
===========================
    Destroy object before replacing it with other one
    (try to compile util/obj2bin.pp to examine this leak)


diff -urN FPC-MY-1.old/fpc/compiler/symsym.pas 
FPC-MY-1/fpc/compiler/symsym.pas
--- FPC-MY-1.old/fpc/compiler/symsym.pas	Sat Jun 15 22:00:31 2002
+++ FPC-MY-1/fpc/compiler/symsym.pas	Sat Jun 15 22:06:49 2002
@@ -1070,11 +1070,11 @@
         index:=overriden.index;
         default:=overriden.default;
         indextype:=overriden.indextype;
-        readaccess.clear;
+        readaccess.free;
         readaccess:=overriden.readaccess.getcopy;
-        writeaccess.clear;
+        writeaccess.free;
         writeaccess:=overriden.writeaccess.getcopy;
-        storedaccess.clear;
+        storedaccess.free;
         storedaccess:=overriden.storedaccess.getcopy;
       end;
 

------------------

Regards,
	Sergey Korshunoff




More information about the fpc-devel mailing list