sysheap.inc 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2001 by Free Pascal development team
  4. This file implements all the base types and limits required
  5. for a minimal POSIX compliant subset required to port the compiler
  6. to a new OS.
  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. Heap Management
  15. *****************************************************************************}
  16. function __sbrk(size:longint):longint;cdecl;external;
  17. function SysOSAlloc (size: PtrInt): pointer; assembler;
  18. asm
  19. {$ifdef SYSTEMDEBUG}
  20. cmpb $1,accept_sbrk
  21. je .Lsbrk
  22. movl $0,%eax
  23. jmp .Lsbrk_fail
  24. .Lsbrk:
  25. {$endif}
  26. movl size,%eax
  27. pushl %eax
  28. call __sbrk
  29. addl $4,%esp
  30. {$ifdef SYSTEMDEBUG}
  31. .Lsbrk_fail:
  32. {$endif}
  33. end;
  34. {*****************************************************************************
  35. OS Memory allocation / deallocation
  36. ****************************************************************************}
  37. {function SysOSAlloc(size: ptrint): pointer;
  38. begin
  39. result := sbrk(size);
  40. end;
  41. }
  42. {.$define HAS_SYSOSFREE}
  43. procedure SysOSFree(p: pointer; size: ptrint);
  44. begin
  45. end;