Auto merge of #17701 - bholley:reuse_allocations, r=emilio

reuse the bloom filter and style sharing cache across traversals

https://bugzilla.mozilla.org/show_bug.cgi?id=1380198

<!-- 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/17701)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-07-12 16:48:19 -07:00 committed by Emilio Cobos Álvarez
parent af36ce2ae1
commit 6597178b91
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
12 changed files with 140 additions and 39 deletions

View file

@ -14,5 +14,6 @@ servo = ["serde", "heapsize"]
[dependencies]
heapsize = {version = "0.4.0", optional = true}
serde = {version = "1.0", optional = true}
nodrop = {version = "0.1.8"}
serde = {version = "1.0", optional = true}
stable_deref_trait = "1.0.0"

View file

@ -22,14 +22,16 @@
// duplicate those here.
#![allow(missing_docs)]
#[cfg(feature = "servo")] extern crate serde;
extern crate nodrop;
#[cfg(feature = "servo")] extern crate serde;
extern crate stable_deref_trait;
#[cfg(feature = "servo")]
use heapsize::HeapSizeOf;
use nodrop::NoDrop;
#[cfg(feature = "servo")]
use serde::{Deserialize, Serialize};
use stable_deref_trait::{CloneStableDeref, StableDeref};
use std::{isize, usize};
use std::borrow;
use std::cmp::Ordering;
@ -432,6 +434,9 @@ impl<T: ?Sized> AsRef<T> for Arc<T> {
}
}
unsafe impl<T: ?Sized> StableDeref for Arc<T> {}
unsafe impl<T: ?Sized> CloneStableDeref for Arc<T> {}
// This is what the HeapSize crate does for regular arc, but is questionably
// sound. See https://github.com/servo/heapsize/issues/37
#[cfg(feature = "servo")]