-
Notifications
You must be signed in to change notification settings - Fork 273
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
Fix RawTable::allocation_info for empty table #379
Conversation
@@ -531,7 +531,12 @@ impl<T, A: Allocator + Clone> RawTable<T, A> { | |||
#[inline] | |||
#[cfg(feature = "raw")] | |||
pub fn allocation_info(&self) -> (NonNull<u8>, Layout) { | |||
self.table.allocation_info(Self::TABLE_LAYOUT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this check be moved into the method in RawTableInner
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure? This way we will do branch (albeit trivial) for paths we don't use in normal operation.
At the moment I added assertion to RawTableInner.allocation_info
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason for the split between RawTable
and RawTableInner
is to reduce the amount of LLVM IR generated and improve compilation times. In release builds, all the RawTableInner
methods are inlined into the RawTable
methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Updated the PR.
95b794d
to
04447e8
Compare
04447e8
to
471c5a6
Compare
@bors r+ |
☀️ Test successful - checks-actions |
Fixes #376