Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unordered_inline_set #546

Merged
merged 1 commit into from
Aug 26, 2024
Merged

unordered_inline_set #546

merged 1 commit into from
Aug 26, 2024

Conversation

lihuiba
Copy link
Collaborator

@lihuiba lihuiba commented Aug 20, 2024

A hash table with open addressing, i.e. collision is resolved by probing, or searching through alternative locations in the array.

This design avoids allocation and deallocation during insertion and deletion, except rehashing.

it also features the ability to extract (move out) a stored element itself, without involving a "handle".

This is only an initial version that need further test and polish.

@lihuiba lihuiba requested a review from Coldwings August 20, 2024 09:02
@lihuiba lihuiba force-pushed the unordered_inline_set branch 2 times, most recently from 1de012f to 2ff90a7 Compare August 21, 2024 09:03
common/unordered_inline_set.h Show resolved Hide resolved
return extract(find(std::forward<K>(x)));
}
value_type&& extract( iterator position ) {
assert(position._a == &_data);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

position._a position._i are protected field of iterator type
and get_bit is protected

Copy link
Collaborator

@Coldwings Coldwings left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lihuiba lihuiba merged commit 1730878 into alibaba:main Aug 26, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants