diff options
| author | bors <bors@rust-lang.org> | 2015-05-31 09:53:49 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-05-31 09:53:49 +0000 |
| commit | 243e85f393a9e4527d814ecc9dfe23d2e3f9c737 (patch) | |
| tree | c5e3a4d340de4c412277ddf3a02a563726916a3f /src/libstd | |
| parent | 93991f75555c5fdb48bc69480c78dd3ff9cc8dd5 (diff) | |
| parent | 4a4315bf4bbd8559020689ff6e99d44004c8adb8 (diff) | |
| download | rust-243e85f393a9e4527d814ecc9dfe23d2e3f9c737.tar.gz rust-243e85f393a9e4527d814ecc9dfe23d2e3f9c737.zip | |
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).
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/collections/hash/table.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libstd/collections/hash/table.rs b/src/libstd/collections/hash/table.rs index 4841f36c7f7..2616bc52785 100644 --- a/src/libstd/collections/hash/table.rs +++ b/src/libstd/collections/hash/table.rs @@ -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) |
