1{ 2 This file is part of the Free Pascal run time library. 3 Copyright (c) 2005 by Free Pascal development team 4 5 Low level memory functions 6 7 Heap functions unit for Nintendo DS 8 Copyright (c) 2006 by Francesco Lombardi 9 10 See the file COPYING.FPC, included in this distribution, 11 for details about the copyright. 12 13 This program is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 17 **********************************************************************} 18 19{***************************************************************************** 20 OS Memory allocation / deallocation 21 ****************************************************************************} 22 23function sbrk2(size: longint): pointer; cdecl; external name 'sbrk'; 24 25function SysOSAlloc(size: ptruint): pointer; 26begin 27 result := sbrk2(size); 28 if result = pointer(-1) then 29 result := nil 30end; 31 32procedure SysOSFree(p: pointer; size: ptruint); 33begin 34 sbrk2(-size); 35end; 36 37 38(* 39var 40 heap_start: longint; external name '_end'; 41 42function SysOSAlloc(size: ptruint): pointer; 43begin 44 result := @heap_start; 45end; 46 47{ $define HAS_SYSOSFREE} 48 49procedure SysOSFree(p: pointer; size: ptruint); 50begin 51 52end; 53*) 54