sysheap.inc 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 2001 by Free Pascal development team
  5. This file implements all the base types and limits required
  6. for a minimal POSIX compliant subset required to port the compiler
  7. to a new OS.
  8. See the file COPYING.FPC, included in this distribution,
  9. for details about the copyright.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. **********************************************************************}
  14. {*****************************************************************************
  15. Heap Management
  16. *****************************************************************************}
  17. function __sbrk(size:longint):longint;cdecl;external;
  18. function SysOSAlloc (size: PtrInt): pointer; assembler;
  19. asm
  20. {$ifdef SYSTEMDEBUG}
  21. cmpb $1,accept_sbrk
  22. je .Lsbrk
  23. movl $0,%eax
  24. jmp .Lsbrk_fail
  25. .Lsbrk:
  26. {$endif}
  27. movl size,%eax
  28. pushl %eax
  29. call __sbrk
  30. addl $4,%esp
  31. {$ifdef SYSTEMDEBUG}
  32. .Lsbrk_fail:
  33. {$endif}
  34. end;
  35. {*****************************************************************************
  36. OS Memory allocation / deallocation
  37. ****************************************************************************}
  38. {function SysOSAlloc(size: ptrint): pointer;
  39. begin
  40. result := sbrk(size);
  41. end;
  42. }
  43. {.$define HAS_SYSOSFREE}
  44. procedure SysOSFree(p: pointer; size: ptrint);
  45. begin
  46. end;
  47. {
  48. $Log$
  49. Revision 1.1 2005-02-06 16:57:18 peter
  50. * threads for go32v2,os,emx,netware
  51. Revision 1.1 2005/02/06 13:06:20 peter
  52. * moved file and dir functions to sysfile/sysdir
  53. * win32 thread in systemunit
  54. }