mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Bug 1398593 - stylo: mitigate performance impact of fallible allocation on stylist rebuilds. r=emilio.
This commit is contained in:
parent
61fac2c10d
commit
e7e03fac7b
2 changed files with 3 additions and 2 deletions
|
@ -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")]
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue