Skip to content

Commit

Permalink
Auto merge of #25921 - eddyb:inline-calculate-offsets, r=Aatch
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
bors committed May 31, 2015
2 parents 93991f7 + 4a4315b commit 243e85f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/libstd/collections/hash/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 243e85f

Please sign in to comment.