mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-05 09:18:15 +02:00
31 lines
715 B
PHP
31 lines
715 B
PHP
{*****************************************************************************
|
|
OS Memory allocation / deallocation
|
|
****************************************************************************}
|
|
|
|
function ___sbrk(size:longint):pointer;cdecl; external name '___sbrk';
|
|
|
|
function SysOSAlloc(size: ptrint): 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;
|
|
|
|
{ define HAS_SYSOSFREE}
|
|
|
|
procedure SysOSFree(p: pointer; size: ptrint);
|
|
begin
|
|
end;
|
|
|