hashmap does not grow #3

Closed
opened 2016-09-25 21:12:19 +00:00 by benibela · 1 comment
benibela commented 2016-09-25 21:12:19 +00:00 (Migrated from github.com)
program Project1;

{$mode objfpc}{$H+}

uses
  cthreads, sysutils,
  Classes, PasMP;


var
  map: TPasMPStringHashTable;
  p: PAnsiString;
  data: array[0..1000] of string;
  i: Integer;
begin
  map := TPasMPStringHashTable.Create(sizeof(pointer));
  for i := 0 to 1000 do begin
    writeln(i);
    data[i] := inttostr(i);
    p := @data[i];
    map.SetKeyValue(data[i], p);
  end;
  map.Free;

end.

After inserting the 48th item the hash map wants to grow, but fails to do so, and then is stuck

``` program Project1; {$mode objfpc}{$H+} uses cthreads, sysutils, Classes, PasMP; var map: TPasMPStringHashTable; p: PAnsiString; data: array[0..1000] of string; i: Integer; begin map := TPasMPStringHashTable.Create(sizeof(pointer)); for i := 0 to 1000 do begin writeln(i); data[i] := inttostr(i); p := @data[i]; map.SetKeyValue(data[i], p); end; map.Free; end. ``` After inserting the 48th item the hash map wants to grow, but fails to do so, and then is stuck
BeRo1985 commented 2016-09-25 21:24:59 +00:00 (Migrated from github.com)

Fixed :-)

Fixed :-)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
BeRo1985/pasmp#3
No description provided.