|
@@ -1,11 +1,11 @@
|
|
|
{
|
|
|
$Id$
|
|
|
This file is part of the Free Pascal run time library.
|
|
|
- Copyright (c) 1999 by Michael Van Canneyt, member of the
|
|
|
+ Copyright (c) 1999 by Michael Van Canneyt, member of the
|
|
|
Free Pascal development team
|
|
|
|
|
|
Implements a memory manager that uses the C memory management.
|
|
|
-
|
|
|
+
|
|
|
See the file COPYING.FPC, included in this distribution,
|
|
|
for details about the copyright.
|
|
|
|
|
@@ -29,7 +29,6 @@ Const
|
|
|
|
|
|
Function Malloc (Size : Longint) : Pointer; {$ifndef win32}stdcall{$else}cdecl{$endif}; external LibName name 'malloc';
|
|
|
Procedure Free (P : pointer); {$ifndef win32}stdcall{$else}cdecl{$endif}; external LibName name 'free';
|
|
|
-Procedure FreeMem (P : Pointer); {$ifndef win32}stdcall{$else}cdecl{$endif}; external LibName name 'free';
|
|
|
function ReAlloc (P : Pointer; Size : longint) : pointer; {$ifndef win32}stdcall{$else}cdecl{$endif}; external LibName name 'realloc';
|
|
|
Function CAlloc (unitSize,UnitCount : Longint) : pointer; {$ifndef win32}stdcall{$else}cdecl{$endif}; external LibName name 'calloc';
|
|
|
|
|
@@ -41,14 +40,14 @@ begin
|
|
|
result:=Malloc(Size);
|
|
|
end;
|
|
|
|
|
|
-Function CFreeMem (P : pointer) : Longint;
|
|
|
+Function CFreeMem ({$ifdef VER1_0}var{$endif} P : pointer) : Longint;
|
|
|
|
|
|
begin
|
|
|
Free(P);
|
|
|
Result:=0;
|
|
|
end;
|
|
|
|
|
|
-Function CFreeMemSize(p:pointer;Size:Longint):Longint;
|
|
|
+Function CFreeMemSize({$ifdef VER1_0}var{$endif} p:pointer;Size:Longint):Longint;
|
|
|
|
|
|
begin
|
|
|
Result:=CFreeMem(P);
|
|
@@ -57,7 +56,7 @@ end;
|
|
|
Function CAllocMem(Size : Longint) : Pointer;
|
|
|
|
|
|
begin
|
|
|
- Result:=calloc(Size,1);
|
|
|
+ Result:=calloc(Size,1);
|
|
|
end;
|
|
|
|
|
|
Function CReAllocMem (var p:pointer;Size:longint):Pointer;
|
|
@@ -90,7 +89,7 @@ Function CHeapSize : Longint;
|
|
|
begin
|
|
|
Result:=0;
|
|
|
end;
|
|
|
-
|
|
|
+
|
|
|
|
|
|
Const
|
|
|
CMemoryManager : TMemoryManager =
|
|
@@ -105,21 +104,24 @@ Const
|
|
|
MaxAvail : {$ifdef fpc}@{$endif}MaxAvail;
|
|
|
HeapSize : {$ifdef fpc}@{$endif}CHeapSize;
|
|
|
);
|
|
|
-
|
|
|
-Var
|
|
|
+
|
|
|
+Var
|
|
|
OldMemoryManager : TMemoryManager;
|
|
|
|
|
|
Initialization
|
|
|
GetMemoryManager (OldMemoryManager);
|
|
|
SetMemoryManager (CmemoryManager);
|
|
|
-
|
|
|
+
|
|
|
Finalization
|
|
|
SetMemoryManager (OldMemoryManager);
|
|
|
end.
|
|
|
|
|
|
-{
|
|
|
+{
|
|
|
$Log$
|
|
|
- Revision 1.3 2002-06-13 05:01:44 michael
|
|
|
+ Revision 1.4 2002-07-01 16:24:04 peter
|
|
|
+ * updates for 1.0 compiler
|
|
|
+
|
|
|
+ Revision 1.3 2002/06/13 05:01:44 michael
|
|
|
+ Added windows msvcrt support
|
|
|
|
|
|
Revision 1.2 2002/06/13 04:54:47 michael
|
|
@@ -139,5 +141,5 @@ end.
|
|
|
|
|
|
Revision 1.2 2000/07/13 11:33:10 michael
|
|
|
+ removed logs
|
|
|
-
|
|
|
+
|
|
|
}
|