Server Side Delphi - Kestral Computing Start Index Next

How to Write a Custom Memory Manager

You need to provide the following 3 methods and then use this unit that loads them like this as the first unit in your program

unit Sharemem;

....

function SysGetMem(Size: Integer): Pointer;
function SysFreeMem(P: Pointer): Integer;
function SysReallocMem(P: Pointer; Size: Integer): Pointer;
.....


const
SharedMemoryManager: TMemoryManager = (
         GetMem: SysGetMem;
         FreeMem: SysFreeMem;
         ReallocMem: SysReallocMem);

initialization
 if not IsMemoryManagerSet then SetMemoryManager(SharedMemoryManager);
end.

 
Grahame Grieve