Skip to content

Commit a386031

Browse files
committed
Rebase on top of the main branch.
1 parent 8494044 commit a386031

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

src/external_trait_impls/paralight.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ impl<T: Sync, A: Allocator> SourceCleanup for HashSetRefSourceDescriptor<'_, T,
4848
const NEEDS_CLEANUP: bool = false;
4949

5050
fn len(&self) -> usize {
51-
self.table.inner.buckets()
51+
self.table.inner.num_buckets()
5252
}
5353

5454
unsafe fn cleanup_item_range(&self, _range: core::ops::Range<usize>) {
@@ -121,7 +121,7 @@ impl<K: Sync, V: Sync, A: Allocator> SourceCleanup for HashMapRefSourceDescripto
121121
const NEEDS_CLEANUP: bool = false;
122122

123123
fn len(&self) -> usize {
124-
self.table.inner.buckets()
124+
self.table.inner.num_buckets()
125125
}
126126

127127
unsafe fn cleanup_item_range(&self, _range: core::ops::Range<usize>) {
@@ -195,7 +195,7 @@ impl<K: Sync, V: Send, A: Allocator> SourceCleanup for HashMapRefMutSourceDescri
195195
const NEEDS_CLEANUP: bool = false;
196196

197197
fn len(&self) -> usize {
198-
self.table.inner.buckets()
198+
self.table.inner.num_buckets()
199199
}
200200

201201
unsafe fn cleanup_item_range(&self, _range: core::ops::Range<usize>) {
@@ -274,7 +274,7 @@ impl<T: Send, A: Allocator> SourceCleanup for HashSetSourceDescriptor<T, A> {
274274
const NEEDS_CLEANUP: bool = core::mem::needs_drop::<T>();
275275

276276
fn len(&self) -> usize {
277-
self.table.inner.buckets()
277+
self.table.inner.num_buckets()
278278
}
279279

280280
unsafe fn cleanup_item_range(&self, range: core::ops::Range<usize>) {
@@ -392,7 +392,7 @@ impl<K: Send, V: Send, A: Allocator> SourceCleanup for HashMapSourceDescriptor<K
392392
const NEEDS_CLEANUP: bool = core::mem::needs_drop::<(K, V)>();
393393

394394
fn len(&self) -> usize {
395-
self.table.inner.buckets()
395+
self.table.inner.num_buckets()
396396
}
397397

398398
unsafe fn cleanup_item_range(&self, range: core::ops::Range<usize>) {

src/raw/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,13 +1500,15 @@ impl<T, A: Allocator> RawTable<T, A> {
15001500

15011501
// Avoid `Option::unwrap_or_else` because it bloats LLVM IR.
15021502
let (layout, ctrl_offset) =
1503-
match Self::TABLE_LAYOUT.calculate_layout_for(self.table.buckets()) {
1503+
match Self::TABLE_LAYOUT.calculate_layout_for(self.table.num_buckets()) {
15041504
Some(lco) => lco,
15051505
None => unsafe { hint::unreachable_unchecked() },
15061506
};
15071507
let ptr =
15081508
unsafe { NonNull::new_unchecked(self.table.ctrl.as_ptr().sub(ctrl_offset).cast()) };
1509-
self.alloc.deallocate(ptr, layout);
1509+
unsafe {
1510+
self.alloc.deallocate(ptr, layout);
1511+
}
15101512

15111513
// Reset the table, so that it can be dropped without double free.
15121514
self.table = RawTableInner::NEW;

0 commit comments

Comments
 (0)