unit dhashmap_rtl;

{$MODE FPC}
{$MODESWITCH ADVANCEDRECORDS}
{$MODESWITCH DEFAULTPARAMETERS}
{$MODESWITCH OUT}
{$MODESWITCH RESULT}

interface

type
PHashMapAllocator = ^THashMapAllocator;
THashMapAllocator = object
  procedure Init(Userdata: Pointer);
  procedure Done;
  function GetMem(Size: SizeUInt): Pointer; inline;
  procedure FreeMem(P: Pointer); inline;
  function ReallocMem(var P: Pointer; Size: SizeUInt): Pointer; inline;
end;

THashMapKey = AnsiString;

THashMapHashValue = UInt32;

PHashMapKeyManager = ^THashMapKeyManager;
THashMapKeyManager = object
  procedure Init(Userdata: Pointer);
  procedure Done;
  function Copy(out Dst: THashMapKey; const Src: THashMapKey);
end;

implementation

procedure THashMapAllocator.Init(Userdata: Pointer);
begin
end;

procedure THashMapAllocator.Done;
begin
end;

function THashMapAllocator.GetMem(Size: SizeUInt): Pointer;
begin
  Exit(System.GetMem(Size));
end;

procedure THashMapAllocator.FreeMem(P: Pointer);
begin
  System.FreeMem(P, Size);
end;

function THashMapAllocator.ReallocMem(var P: Pointer; Size: SizeUInt): Pointer;
begin
  Exit(System.ReallocMem(P, Size));
end;

end.
