sysheap.inc 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. OS Memory allocation / deallocation
  16. ****************************************************************************}
  17. function SysOSAlloc(size: ptrint): pointer;
  18. begin
  19. result:=Fpmmap(nil,Size,3,MAP_PRIVATE+MAP_ANONYMOUS,-1,0);
  20. if result=pointer(-1) then
  21. result:=nil
  22. else
  23. seterrno(0);
  24. end;
  25. {$define HAS_SYSOSFREE}
  26. procedure SysOSFree(p: pointer; size: ptrint);
  27. begin
  28. fpmunmap(p, size);
  29. end;
  30. {
  31. $Log$
  32. Revision 1.2 2005-02-06 12:16:52 peter
  33. * bsd thread updates
  34. Revision 1.1 2005/02/06 11:20:52 peter
  35. * threading in system unit
  36. * removed systhrds unit
  37. }