2
This file is part of the Free Pascal run time library.
3
Copyright (c) 2001 by Free Pascal development team
5
This file implements all the base types and limits required
6
for a minimal POSIX compliant subset required to port the compiler
9
See the file COPYING.FPC, included in this distribution,
10
for details about the copyright.
12
This program is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
**********************************************************************}
19
{****************************************************************************
21
Heap management releated routines.
23
****************************************************************************}
26
{ this function allows to extend the heap by calling
27
syscall $7f00 resizes the brk area}
29
function sbrk(size:longint):pointer;
34
WriteLn ('Trying to grow heap by ', Size);
36
WriteLn ('BrkLimit is ', BrkLimit);
41
call syscall { result directly in EAX }
42
inc %eax { Result in EAX, -1 = error (has to be transformed to 0) }
44
dec %eax { No error - back to previous value }
48
WriteLn ('New heap at ', L);
61
inc %eax { Result in EAX, -1 = error (has to be transformed to 0) }
63
dec %eax { No error - back to previous value }
68
function SysOSAlloc (Size: ptrint): pointer;
70
SysOSAlloc := Sbrk (Size);
73
{.$define HAS_SYSOSFREE}
75
procedure SysOSFree (P: pointer; Size: ptrint);