mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-23 13:01:45 +02:00
* postpone some freeing if SymbolInfo is needed
git-svn-id: trunk@6018 -
This commit is contained in:
parent
fa2a66c48d
commit
cc73d6e147
@ -277,6 +277,7 @@ implementation
|
|||||||
|
|
||||||
var
|
var
|
||||||
olddata : polddata;
|
olddata : polddata;
|
||||||
|
hp,hp2 : tmodule;
|
||||||
begin
|
begin
|
||||||
inc(compile_level);
|
inc(compile_level);
|
||||||
parser_current_file:=filename;
|
parser_current_file:=filename;
|
||||||
@ -471,6 +472,24 @@ implementation
|
|||||||
(status.errorcount=0) then
|
(status.errorcount=0) then
|
||||||
begin
|
begin
|
||||||
parser_current_file:='';
|
parser_current_file:='';
|
||||||
|
{ Write Browser Collections }
|
||||||
|
do_extractsymbolinfo;
|
||||||
|
{ free now what we did not free earlier in
|
||||||
|
proc_program PM }
|
||||||
|
if needsymbolinfo then
|
||||||
|
begin
|
||||||
|
hp:=tmodule(loaded_units.first);
|
||||||
|
while assigned(hp) do
|
||||||
|
begin
|
||||||
|
hp2:=tmodule(hp.next);
|
||||||
|
if (hp<>current_module) then
|
||||||
|
begin
|
||||||
|
loaded_units.remove(hp);
|
||||||
|
hp.free;
|
||||||
|
end;
|
||||||
|
hp:=hp2;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
{ Close script }
|
{ Close script }
|
||||||
if (not AsmRes.Empty) then
|
if (not AsmRes.Empty) then
|
||||||
begin
|
begin
|
||||||
|
@ -1482,8 +1482,13 @@ implementation
|
|||||||
{ assemble and link }
|
{ assemble and link }
|
||||||
create_objectfile;
|
create_objectfile;
|
||||||
|
|
||||||
|
{ We might need the symbols info if not using
|
||||||
|
the default do_extractsymbolinfo
|
||||||
|
which is a dummy function PM }
|
||||||
|
needsymbolinfo:=do_extractsymbolinfo<>@def_extractsymbolinfo;;
|
||||||
{ release all local symtables that are not needed anymore }
|
{ release all local symtables that are not needed anymore }
|
||||||
free_localsymtables(current_module.localsymtable);
|
if (not needsymbolinfo) then
|
||||||
|
free_localsymtables(current_module.localsymtable);
|
||||||
|
|
||||||
{ leave when we got an error }
|
{ leave when we got an error }
|
||||||
if (Errorcount>0) and not status.skip_error then
|
if (Errorcount>0) and not status.skip_error then
|
||||||
@ -1509,7 +1514,8 @@ implementation
|
|||||||
begin
|
begin
|
||||||
linker.AddModuleFiles(hp);
|
linker.AddModuleFiles(hp);
|
||||||
hp2:=tmodule(hp.next);
|
hp2:=tmodule(hp.next);
|
||||||
if hp<>current_module then
|
if (hp<>current_module) and
|
||||||
|
(not needsymbolinfo) then
|
||||||
begin
|
begin
|
||||||
loaded_units.remove(hp);
|
loaded_units.remove(hp);
|
||||||
hp.free;
|
hp.free;
|
||||||
|
Loading…
Reference in New Issue
Block a user