home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 March / pcp161b.iso / full / delphi / RUNIMAGE / DELPHI30 / SOURCE / RTL / SYS / SHAREMEM.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1997-08-03  |  1.4 KB  |  47 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Delphi Runtime Library                          }
  5. {                                                       }
  6. {       Copyright (C) 1995,97 Borland International     }
  7. {                                                       }
  8. {*******************************************************}
  9.  
  10. unit ShareMem;
  11.  
  12. interface
  13.  
  14.  
  15. function SysGetMem(Size: Integer): Pointer;
  16. function SysFreeMem(P: Pointer): Integer;
  17. function SysReallocMem(P: Pointer; Size: Integer): Pointer;
  18. function GetHeapStatus: THeapStatus;
  19. function GetAllocMemCount: Integer;
  20. function GetAllocMemSize: Integer;
  21.  
  22.  
  23. implementation
  24.  
  25.  
  26. const
  27.   DelphiMM = 'delphimm.dll';
  28.  
  29. function SysGetMem(Size: Integer): Pointer; external DelphiMM;
  30. function SysFreeMem(P: Pointer): Integer; external DelphiMM;
  31. function SysReallocMem(P: Pointer; Size: Integer): Pointer; external DelphiMM;
  32. function GetHeapStatus: THeapStatus; external DelphiMM;
  33. function GetAllocMemCount: Integer; external DelphiMM;
  34. function GetAllocMemSize: Integer; external DelphiMM;
  35.  
  36.  
  37. const
  38.   SharedMemoryManager: TMemoryManager = (
  39.     GetMem: SysGetMem;
  40.     FreeMem: SysFreeMem;
  41.     ReallocMem: SysReallocMem);
  42.  
  43. initialization
  44.   if not IsMemoryManagerSet then
  45.     SetMemoryManager(SharedMemoryManager);
  46. end.
  47.