mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 00:09:32 +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
|
||||
olddata : polddata;
|
||||
hp,hp2 : tmodule;
|
||||
begin
|
||||
inc(compile_level);
|
||||
parser_current_file:=filename;
|
||||
@ -471,6 +472,24 @@ implementation
|
||||
(status.errorcount=0) then
|
||||
begin
|
||||
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 }
|
||||
if (not AsmRes.Empty) then
|
||||
begin
|
||||
|
@ -1482,8 +1482,13 @@ implementation
|
||||
{ assemble and link }
|
||||
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 }
|
||||
free_localsymtables(current_module.localsymtable);
|
||||
if (not needsymbolinfo) then
|
||||
free_localsymtables(current_module.localsymtable);
|
||||
|
||||
{ leave when we got an error }
|
||||
if (Errorcount>0) and not status.skip_error then
|
||||
@ -1509,7 +1514,8 @@ implementation
|
||||
begin
|
||||
linker.AddModuleFiles(hp);
|
||||
hp2:=tmodule(hp.next);
|
||||
if hp<>current_module then
|
||||
if (hp<>current_module) and
|
||||
(not needsymbolinfo) then
|
||||
begin
|
||||
loaded_units.remove(hp);
|
||||
hp.free;
|
||||
|
Loading…
Reference in New Issue
Block a user