palmos: implemented sysosalloc/free for the heap

git-svn-id: trunk@37248 -
This commit is contained in:
Károly Balogh 2017-09-18 11:14:48 +00:00
parent e896c16b4f
commit 790c1f87f1
2 changed files with 10 additions and 0 deletions

View File

@ -65,4 +65,11 @@ const
procedure SndPlaySystemSound(beepID: Word); syscall sysTrapSndPlaySystemSound;
const
sysTrapMemChunkFree = $A012;
sysTrapMemPtrNew = $A013;
function MemPtrNew(size: UInt32): MemPtr; syscall sysTrapMemPtrNew;
function MemPtrFree(chunkDataP: MemPtr): Err; syscall sysTrapMemChunkFree;
{$PACKRECORDS DEFAULT}

View File

@ -20,10 +20,13 @@
function SysOSAlloc(size: ptruint): pointer;
begin
SysOSAlloc:=MemPtrNew(size);
end;
{$define HAS_SYSOSFREE}
procedure SysOSFree(p: pointer; size: ptruint);
begin
if (p <> nil) then
MemPtrFree(p);
end;