On 4/7/2015 3:59 PM, Andrei Alexandrescu wrote:
On 4/7/15 3:56 PM, Walter Bright wrote:
On 4/7/2015 3:14 PM, Andrei Alexandrescu wrote:
Arrays would need to move data. Current hashtables rely on values
staying put.

If the array of buckets were enhanced to include the hashes, the
key/value objects could stay untouched when the AA is grown. The
key/value objects would only be dereferenced if the hashes matched.

Not sure I understand. What if the collision array needs to grow? That might
move it. -- Andrei

The collision array is an array of pairs:

    KeyValue *kv;
    Hash_t hash;

growing the array moves those around, but the locations of the array elements are never exposed to the users. The addresses of kv are exposed, but those don't move.

Reply via email to