Bucket_Array module

Bucket_Locator

structSource

Where an element lives: the number of its bucket and its slot in that bucket.

A locator stays valid, and keeps naming the same element, until that element is removed or the array is reset. Using a locator whose element was removed fails an assert for as long as the slot stays free (bucket_array_find, bucket_array_find_pointer and bucket_array_remove all check it). Once a later add reuses the slot the locator is not detected as stale: it then names the new occupant, so drop locators when you remove their elements.

Fields

bucket_index: u32
slot_index: s32

See also