aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-09-12 15:25:52 -0500
committerGitHub <noreply@github.com>2017-09-12 15:25:52 -0500
commit66778851a80d3227e396c1d6d35c585265327f57 (patch)
tree1833f750f962b8c42330bf70f4077ab012c034fb
parentb856f11388b629759773a905379b1f238a9ca348 (diff)
parente7e03fac7b3afb61675d954f3a2d37b24947fddf (diff)
downloadservo-66778851a80d3227e396c1d6d35c585265327f57.tar.gz
servo-66778851a80d3227e396c1d6d35c585265327f57.zip
Auto merge of #18460 - julian-seward1:master, r=emilio
Bug 1398593 - stylo: mitigate performance impact of fallible allocati… …on on stylist rebuilds. r=emilio. <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18460) <!-- Reviewable:end -->
-rw-r--r--components/fallible/lib.rs4
-rw-r--r--components/hashglobe/src/hash_map.rs1
2 files changed, 3 insertions, 2 deletions
diff --git a/components/fallible/lib.rs b/components/fallible/lib.rs
index 816e20573f9..4a48190a1eb 100644
--- a/components/fallible/lib.rs
+++ b/components/fallible/lib.rs
@@ -27,7 +27,7 @@ pub trait FallibleVec<T> {
// Vec
impl<T> FallibleVec<T> for Vec<T> {
- #[inline]
+ #[inline(always)]
fn try_push(&mut self, val: T) -> Result<(), FailedAllocationError> {
#[cfg(feature = "known_system_malloc")]
{
@@ -92,7 +92,7 @@ fn try_double_vec<T>(vec: &mut Vec<T>) -> Result<(), FailedAllocationError> {
// SmallVec
impl<T: Array> FallibleVec<T::Item> for SmallVec<T> {
- #[inline]
+ #[inline(always)]
fn try_push(&mut self, val: T::Item) -> Result<(), FailedAllocationError> {
#[cfg(feature = "known_system_malloc")]
{
diff --git a/components/hashglobe/src/hash_map.rs b/components/hashglobe/src/hash_map.rs
index c73f88cef66..69bd06344e0 100644
--- a/components/hashglobe/src/hash_map.rs
+++ b/components/hashglobe/src/hash_map.rs
@@ -1002,6 +1002,7 @@ impl<K, V, S> HashMap<K, V, S>
self.try_entry(key).unwrap()
}
+ #[inline(always)]
pub fn try_entry(&mut self, key: K) -> Result<Entry<K, V>, FailedAllocationError> {
// Gotta resize now.
self.try_reserve(1)?;