sysheap.inc 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. function SysOSAlloc(size: ptrint): pointer;
  15. begin
  16. result:=Fpmmap(nil,Size,3,MAP_PRIVATE+MAP_ANONYMOUS,-1,0);
  17. if result=pointer(-1) then
  18. result:=nil
  19. else
  20. seterrno(0);
  21. end;
  22. {$define HAS_SYSOSFREE}
  23. procedure SysOSFree(p: pointer; size: ptrint);
  24. begin
  25. fpmunmap(p, size);
  26. end;
  27. {
  28. $Log$
  29. Revision 1.1 2005-02-07 22:04:55 peter
  30. * moved to unix
  31. Revision 1.1 2005/02/06 16:57:18 peter
  32. * threads for go32v2,os,emx,netware
  33. Revision 1.1 2005/02/06 13:06:20 peter
  34. * moved file and dir functions to sysfile/sysdir
  35. * win32 thread in systemunit
  36. }