sysheap.inc 1.3 KB

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