mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-06 00:10:19 +02:00
+ RelocateHeap: tolerate being called more than once.
git-svn-id: trunk@17762 -
This commit is contained in:
parent
3cdbe30c28
commit
3e145f6d77
@ -1507,11 +1507,13 @@ var
|
||||
loc_freelists: pfreelists;
|
||||
begin
|
||||
{ this function should be called in main thread context }
|
||||
loc_freelists := @freelists;
|
||||
{$ifdef FPC_HAS_FEATURE_THREADING}
|
||||
if heap_lock_use > 0 then
|
||||
exit;
|
||||
heap_lock_use := 1;
|
||||
initcriticalsection(heap_lock);
|
||||
{$endif}
|
||||
loc_freelists := @freelists;
|
||||
{ loc_freelists still points to main thread's freelists, but they
|
||||
have a reference to the global main freelists, fix them to point
|
||||
to the main thread specific variable }
|
||||
|
Loading…
Reference in New Issue
Block a user