sysheap.inc 929 B

123456789101112131415161718192021222324252627282930313233
  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. function SysOSAlloc(size: ptruint): pointer;
  14. begin
  15. result:=Fpmmap(nil,Size,3,MAP_PRIVATE+MAP_ANONYMOUS,-1,0);
  16. if result=pointer(-1) then
  17. result:=nil
  18. else
  19. seterrno(0);
  20. end;
  21. {$define HAS_SYSOSFREE}
  22. procedure SysOSFree(p: pointer; size: ptruint);
  23. begin
  24. fpmunmap(p, size);
  25. end;