2
$Id: sysheap.inc,v 1.1 2005/02/07 21:30:12 peter Exp $
3
2
This file is part of the Free Pascal run time library.
4
Copyright (c) 2001 by Free Pascal development team
3
Copyright (c) 2005 by Free Pascal development team
6
This file implements all the base types and limits required
7
for a minimal POSIX compliant subset required to port the compiler
5
Low level memory functions
10
7
See the file COPYING.FPC, included in this distribution,
11
8
for details about the copyright.
17
14
**********************************************************************}
16
{ Enable this for memory allocation debugging }
17
{DEFINE MOSFPC_MEMDEBUG}
19
19
{*****************************************************************************
20
20
OS Memory allocation / deallocation
21
21
****************************************************************************}
23
23
function SysOSAlloc(size: ptrint): pointer;
24
{$IFDEF MOSFPC_MEMDEBUG}
25
var values: array[0..2] of dword;
25
28
result:=AllocPooled(MOS_heapPool,size);
29
{$IFDEF MOSFPC_MEMDEBUG}
30
values[0]:=dword(result);
31
values[1]:=dword(size);
32
values[2]:=DWord(Sptr-StackBottom);
33
RawDoFmt('FPC_MEM_DEBUG: $%lx:=SysOSAlloc(%ld), free stack: %ld bytes'+#10,@values,pointer(1),nil);
28
37
{$define HAS_SYSOSFREE}
30
39
procedure SysOSFree(p: pointer; size: ptrint);
40
{$IFDEF MOSFPC_MEMDEBUG}
41
var values: array[0..2] of dword;
32
44
FreePooled(MOS_heapPool,p,size);
45
{$IFDEF MOSFPC_MEMDEBUG}
47
values[1]:=dword(size);
48
values[2]:=DWord(Sptr-StackBottom);
49
RawDoFmt('FPC_MEM_DEBUG: SysOSFree($%lx,%ld), free stack: %ld bytes'+#10,@values,pointer(1),nil);
38
Revision 1.1 2005/02/07 21:30:12 peter
41
Revision 1.1 2005/02/06 16:57:18 peter
42
* threads for go32v2,os,emx,netware
44
Revision 1.1 2005/02/06 13:06:20 peter
45
* moved file and dir functions to sysfile/sysdir
46
* win32 thread in systemunit