Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/raw/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,8 @@ impl<T> RawTable<T> {
pub fn new() -> Self {
Self {
data: NonNull::dangling(),
ctrl: NonNull::from(&Group::static_empty()[0]),
// Be careful to cast the entire slice to a raw pointer.
ctrl: unsafe { NonNull::new_unchecked(Group::static_empty().as_ptr() as *mut u8) },
Copy link
Member Author

Choose a reason for hiding this comment

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

Btw, the mut cast here is actually meaningful -- the rest of the code must be careful not to write to this! But I suppose that's already the case, this is a shared global static after all.

bucket_mask: 0,
items: 0,
growth_left: 0,
Expand Down