Skip to content

Commit 243e85f

Browse files
committed
Auto merge of #25921 - eddyb:inline-calculate-offsets, r=Aatch
The `HashMap` and `HashSet` iterators use `RawTable::first_bucket_raw` which is generic and will get inlined cross-crate. However, `first_bucket_raw` calls `calculate_offsets` and the call doesn't get inlined, despite being a simple function. This missing `#[inline]` results in `hash_table::calculate_offsets` showing up at the top of a callgrind profile with 3 million calls (for the testcase in #25916).
2 parents 93991f7 + 4a4315b commit 243e85f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/libstd/collections/hash/table.rs

+1
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,7 @@ fn test_rounding() {
528528

529529
// Returns a tuple of (key_offset, val_offset),
530530
// from the start of a mallocated array.
531+
#[inline]
531532
fn calculate_offsets(hashes_size: usize,
532533
keys_size: usize, keys_align: usize,
533534
vals_align: usize)

0 commit comments

Comments
 (0)