* moved getmem/freemem/memavail/maxavail to heaph.inc

This commit is contained in:
peter 1998-09-08 15:03:27 +00:00
parent b95cabdc60
commit 53dcf00218
2 changed files with 45 additions and 38 deletions

View File

@ -3,6 +3,8 @@
This file is part of the Free Pascal run time library.
Copyright (c) 1993,97 by the Free Pascal development team
Heap manager interface section
See the file COPYING.FPC, included in this distribution,
for details about the copyright.
@ -12,14 +14,29 @@
**********************************************************************}
const
heapblocks : boolean=false;
var
heaporg,heapptr,heapend,heaperror,freelist : pointer;
Procedure release(var p : pointer);
{ Basic (TP7) functions }
Procedure getmem(Var p:pointer;Size:Longint);
Procedure freemem(Var p:pointer;Size:Longint);
Function memavail:Longint;
Function maxavail:Longint;
Procedure mark(var p : pointer);
Procedure release(var p : pointer);
{ Fpc Functions }
Function heapsize : longint;
Procedure markheap(var oldfreelist,oldheapptr : pointer);
Procedure releaseheap(oldfreelist,oldheapptr : pointer);
Function cal_memavail : longint;
Function heapsize : longint;
{$ifdef TEMPHEAP}
{ Temp Heap Functions }
const
allow_special : boolean =true;
Procedure split_heap;
Procedure switch_to_base_heap;
Procedure switch_to_temp_heap;
@ -28,15 +45,12 @@ Function heapsize : longint;
Procedure gettempmem(var p : pointer;size : longint);
{$endif TEMPHEAP}
const
allow_special : boolean =true;
heapblocks : boolean=false;
var
heaporg,heapptr,heapend,heaperror,freelist : pointer;
{
$Log$
Revision 1.5 1998-07-02 14:11:30 michael
Revision 1.6 1998-09-08 15:03:27 peter
* moved getmem/freemem/memavail/maxavail to heaph.inc
Revision 1.5 1998/07/02 14:11:30 michael
Reinstated the heapsize function.
Revision 1.3 1998/05/12 10:42:45 peter

View File

@ -3,6 +3,8 @@
This file is part of the Free Pascal Run time library.
Copyright (c) 1993,97 by the Free Pascal development team
This File contains the OS independent declarations of the system unit
See the File COPYING.FPC, included in this distribution,
for details about the copyright.
@ -12,15 +14,11 @@
**********************************************************************}
{*****************************************************************************
This File contains the OS independent declarations of the system unit
Possible defines:
-----------------
{
Supported conditionnals:
------------------------
RTLLITE Create a somewhat smaller RTL
*****************************************************************************}
}
{****************************************************************************
Support for multiple compiler versions
@ -48,6 +46,7 @@ Type
{ at least declare Turbo Pascal real types }
{$ifdef i386}
StrLenInt = LongInt;
{$ifndef VER0_99_5}
{$ifndef VER0_99_6}
{$define DEFAULT_EXTENDED}
@ -73,9 +72,6 @@ Type
{$endif}
{$endif}
{$ifdef i386}
StrLenInt = LongInt;
{$endif}
{ some type aliases }
dword = cardinal;
longword = cardinal;
@ -90,7 +86,7 @@ Type
const
{ max. values for longint and int}
maxLongint = $7fffffff;
maxint = 32767;
maxint = 32767;
{ Compatibility With TP }
{$ifdef i386}
@ -105,7 +101,7 @@ const
{ max level in dumping on error }
Max_Frame_Dump : Word = 8;
{ Exit Procedure handling consts and types }
ExitProc : pointer=nil;
ExitProc : pointer = nil;
Erroraddr: pointer = nil;
Errorcode: Word = 0;
@ -117,7 +113,8 @@ const
fmAppend = $D7B4;
Filemode : byte = 2;
Type TErrorProc = Procedure (ErrNo : Longint; Address : Pointer);
Type
TErrorProc = Procedure (ErrNo : Longint; Address : Pointer);
var
{ Standard In- and Output }
@ -145,7 +142,7 @@ Procedure FillWord(Var x;count:Longint;Value:Word);
{$endif RTLLITE}
{****************************************************************************
Math Routines
Math Routines
****************************************************************************}
{$ifndef RTLLITE}
@ -161,7 +158,6 @@ Function Swap (X:Word):Word;
Function Swap (X:Integer):Integer;
Function Swap (X:Cardinal):Cardinal;
Function Swap (X:Longint):Longint;
{$ifdef VER0_99_5}
Procedure Inc(Var i:cardinal);
Procedure Inc(Var i:Longint);
@ -196,8 +192,8 @@ Procedure Inc(Var c:Char;a:Longint);
Procedure Dec(Var p:PChar;a:Longint);
Procedure Inc(Var p:PChar;a:Longint);
{$endif VER0_99_5}
{$endif RTLLITE}
Function Chr(b:byte):Char;
Function Length(s:string):byte;
@ -208,19 +204,14 @@ Procedure Randomize;
Function abs(l:Longint):Longint;
Function sqr(l:Longint):Longint;
Function odd(l:Longint):Boolean;
{ float mathe routines }
{ float math routines }
{$I mathh.inc}
{****************************************************************************
Memory management
Addr/Pointer Handling
****************************************************************************}
Procedure getmem(Var p:pointer;Size:Longint);
Procedure freemem(Var p:pointer;Size:Longint);
Function memavail:Longint;
Function maxavail:Longint;
{$ifndef RTLLITE}
Function ptr(sel,off:Longint):pointer;
Function Addr (Var X):pointer;
@ -230,13 +221,12 @@ Function Sseg:Word;
{$endif RTLLITE}
{****************************************************************************
PChar Handling
PChar and String Handling
****************************************************************************}
function strpas(p:pchar):string;
function strlen(p:pchar):longint;
Function Copy(const s:string;index:StrLenInt;count:StrLenInt):string;
Procedure Delete(Var s:string;index:StrLenInt;count:StrLenInt);
Procedure Insert(const source:string;Var s:string;index:StrLenInt);
@ -440,7 +430,10 @@ Procedure halt;
{
$Log$
Revision 1.26 1998-09-04 18:16:14 peter
Revision 1.27 1998-09-08 15:03:28 peter
* moved getmem/freemem/memavail/maxavail to heaph.inc
Revision 1.26 1998/09/04 18:16:14 peter
* uniform filerec/textrec (with recsize:longint and name:0..255)
Revision 1.25 1998/09/01 17:36:22 peter