mirror of
https://github.com/rust-lang/rust
synced 2024-09-05 08:37:14 +00:00
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).
This commit is contained in:
commit
243e85f393
|
@ -528,6 +528,7 @@ fn test_rounding() {
|
|||
|
||||
// Returns a tuple of (key_offset, val_offset),
|
||||
// from the start of a mallocated array.
|
||||
#[inline]
|
||||
fn calculate_offsets(hashes_size: usize,
|
||||
keys_size: usize, keys_align: usize,
|
||||
vals_align: usize)
|
||||
|
|
Loading…
Reference in a new issue