sysheap.inc 1.0 KB

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