summaryrefslogtreecommitdiff
path: root/fpcsrc/rtl/go32v2/sysheap.inc
blob: f3bea3ee95dd94d8c32f344c76abd3947560f716 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{
    This file is part of the Free Pascal run time library.
    Copyright (c) 2001 by Free Pascal development team

    This file implements all the base types and limits required
    for a minimal POSIX compliant subset required to port the compiler
    to a new OS.

    See the file COPYING.FPC, included in this distribution,
    for details about the copyright.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

 **********************************************************************}


{*****************************************************************************
                              Heap Management
*****************************************************************************}

function __sbrk(size:longint):longint;cdecl;external;

function SysOSAlloc (size: ptruint): pointer; assembler;
asm
{$ifdef SYSTEMDEBUG}
        cmpb    $1,accept_sbrk
        je      .Lsbrk
        movl    $0,%eax
        jmp     .Lsbrk_fail
      .Lsbrk:
{$endif}
        movl    size,%eax
        pushl   %eax
        call    __sbrk
        addl    $4,%esp
{$ifdef SYSTEMDEBUG}
      .Lsbrk_fail:
{$endif}
end;

{*****************************************************************************
      OS Memory allocation / deallocation
 ****************************************************************************}

{function SysOSAlloc(size: ptrint): pointer;
begin
  result := sbrk(size);
end;
}
{.$define HAS_SYSOSFREE}

procedure SysOSFree(p: pointer; size: ptruint);
begin
end;