Browse Source

Use FPC_NO_DEFAULT_HEAP to turn out RelocateHeap or MemoryManager.InitThread functions, used for msdos OS

git-svn-id: trunk@33679 -
pierre 9 years ago
parent
commit
cbb29a7e5d
2 changed files with 8 additions and 1 deletions
  1. 6 1
      rtl/inc/thread.inc
  2. 2 0
      rtl/inc/threadvr.inc

+ 6 - 1
rtl/inc/thread.inc

@@ -39,11 +39,14 @@ Var
         SysInitFPU;
         SysInitFPU;
 {$endif}
 {$endif}
 {$ifndef HAS_MEMORYMANAGER}
 {$ifndef HAS_MEMORYMANAGER}
+{$ifndef FPC_NO_DEFAULT_HEAP}
         { initialize this thread's heap }
         { initialize this thread's heap }
         InitHeapThread;
         InitHeapThread;
-{$endif HAS_MEMORYMANAGER}
+{$endif ndef FPC_NO_DEFAULT_HEAP}
+{$else HAS_MEMORYMANAGER}
         if MemoryManager.InitThread <> nil then
         if MemoryManager.InitThread <> nil then
           MemoryManager.InitThread();
           MemoryManager.InitThread();
+{$endif HAS_MEMORYMANAGER}
 {$ifdef FPC_HAS_FEATURE_WIDESTRINGS}
 {$ifdef FPC_HAS_FEATURE_WIDESTRINGS}
         if assigned(widestringmanager.ThreadInitProc) then
         if assigned(widestringmanager.ThreadInitProc) then
           widestringmanager.ThreadInitProc;
           widestringmanager.ThreadInitProc;
@@ -76,7 +79,9 @@ Var
           widestringmanager.ThreadFiniProc;
           widestringmanager.ThreadFiniProc;
 {$endif FPC_HAS_FEATURE_WIDESTRINGS}
 {$endif FPC_HAS_FEATURE_WIDESTRINGS}
 {$ifndef HAS_MEMORYMANAGER}
 {$ifndef HAS_MEMORYMANAGER}
+{$ifndef FPC_NO_DEFAULT_HEAP}
         FinalizeHeap;
         FinalizeHeap;
+{$endif ndef FPC_NO_DEFAULT_HEAP}
 {$endif HAS_MEMORYMANAGER}
 {$endif HAS_MEMORYMANAGER}
         if MemoryManager.DoneThread <> nil then
         if MemoryManager.DoneThread <> nil then
           MemoryManager.DoneThread();
           MemoryManager.DoneThread();

+ 2 - 0
rtl/inc/threadvr.inc

@@ -113,7 +113,9 @@ begin
    fpc_threadvar_relocate_proc:=RelocProc;
    fpc_threadvar_relocate_proc:=RelocProc;
 {$ifdef FPC_HAS_FEATURE_HEAP}
 {$ifdef FPC_HAS_FEATURE_HEAP}
 {$ifndef HAS_MEMORYMANAGER}
 {$ifndef HAS_MEMORYMANAGER}
+{$ifndef FPC_NO_DEFAULT_HEAP}
    RelocateHeap;
    RelocateHeap;
+{$endif ndef FPC_NO_DEFAULT_HEAP}
 {$endif HAS_MEMORYMANAGER}
 {$endif HAS_MEMORYMANAGER}
 {$endif}
 {$endif}
 end;
 end;