library mmgr_g;

uses
  globalmemorymanager;

function mmgr_getmem(nbytes: Integer): Pointer;
begin
  Result := NewGetMem(nbytes);
end;

function mmgr_freemem(ap: Pointer): Integer;
begin
  Result := NewFreeMem(ap);
end;

function mmgr_reallocmem(ap: Pointer; nbytes: Integer): Pointer;
begin
  Result := NewReallocMem(ap,nbytes);
end;  

const
  MNAME = 'globalalloc'#0;

procedure mmgr_name(p: PChar; len: Integer);
begin
  move(MNAME[1],p^,len);
end;

exports
  mmgr_getmem name 'mmgr_getmem',
  mmgr_freemem name 'mmgr_freemem',
  mmgr_reallocmem name 'mmgr_reallocmem',
  mmgr_name name 'mmgr_name';

begin
end.
