mirror of
https://github.com/servo/servo.git
synced 2025-09-29 16:19:14 +01:00
fonts: Measure more FontContext heap usage. (#38733)
Replace a hand-written MallocSizeOf implementation with an automatically derived one. This exposes more than 1MB of previously-untracked heap data on servo.org. Testing: Compared about:memory output for servo.org before and after. Part of: #11559 Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
d490c5c06b
commit
9da8142e2a
8 changed files with 59 additions and 32 deletions
|
@ -22,6 +22,7 @@ pub use font_store::*;
|
|||
pub use font_template::*;
|
||||
pub use glyph::*;
|
||||
use ipc_channel::ipc::IpcSharedMemory;
|
||||
use malloc_size_of_derive::MallocSizeOf;
|
||||
pub use platform::LocalFontIdentifier;
|
||||
pub use shaper::*;
|
||||
pub use system_font_service::*;
|
||||
|
@ -30,8 +31,8 @@ use unicode_properties::{EmojiStatus, UnicodeEmoji, emoji};
|
|||
/// A data structure to store data for fonts. Data is stored internally in an
|
||||
/// [`IpcSharedMemory`] handle, so that it can be send without serialization
|
||||
/// across IPC channels.
|
||||
#[derive(Clone)]
|
||||
pub struct FontData(pub(crate) Arc<IpcSharedMemory>);
|
||||
#[derive(Clone, MallocSizeOf)]
|
||||
pub struct FontData(#[conditional_malloc_size_of] pub(crate) Arc<IpcSharedMemory>);
|
||||
|
||||
impl FontData {
|
||||
pub fn from_bytes(bytes: &[u8]) -> Self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue