mirror of
https://github.com/servo/servo.git
synced 2025-08-11 16:35:33 +01:00
Instrument FreeType allocations.
This will allow reporting of memory usage by FreeType instances, which are measured in the MiBs for LayoutWorker threads. This change also makes FreeType allocations happen with jemalloc instead of the system malloc, which is a good thing. Finally, the change documents some dubiousness involving FontContextHandle.
This commit is contained in:
parent
93a45c91d1
commit
1553fada53
4 changed files with 85 additions and 13 deletions
|
@ -16,6 +16,7 @@ use platform::font_template::FontTemplateData;
|
|||
use smallvec::SmallVec8;
|
||||
use util::cache::HashCache;
|
||||
use util::geometry::Au;
|
||||
use util::mem::HeapSizeOf;
|
||||
|
||||
use std::borrow::{self, ToOwned};
|
||||
use std::cell::RefCell;
|
||||
|
@ -285,6 +286,13 @@ impl FontContext {
|
|||
}
|
||||
}
|
||||
|
||||
impl HeapSizeOf for FontContext {
|
||||
fn heap_size_of_children(&self) -> usize {
|
||||
// FIXME(njn): Measure other fields eventually.
|
||||
self.platform_handle.heap_size_of_children()
|
||||
}
|
||||
}
|
||||
|
||||
struct LayoutFontGroupCacheKey {
|
||||
pointer: Arc<SpecifiedFontStyle>,
|
||||
size: Au,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue