home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1999 February / DPPCPRO0299.ISO / February / Delphi / Install / DATA.Z / SHAREMEM.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-06-09  |  1.3 KB  |  46 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Delphi Runtime Library                          }
  5. {                                                       }
  6. {       Copyright (C) 1995,96 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.   SetMemoryManager(SharedMemoryManager);
  45. end.
  46.