mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Report memory usage for image frames. (#36581)
These changes make the image-cache memory reporter report much larger values after loading image-heavy pages. Testing: Manual testing on https://www.nist.gov/image-gallery Fixes: #36559 Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
d345844ed7
commit
594c04dc7c
2 changed files with 6 additions and 2 deletions
|
@ -688,6 +688,12 @@ impl<T> MallocSizeOf for ipc_channel::ipc::IpcSender<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl MallocSizeOf for ipc_channel::ipc::IpcSharedMemory {
|
||||||
|
fn size_of(&self, _ops: &mut MallocSizeOfOps) -> usize {
|
||||||
|
self.len()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<T: MallocSizeOf> MallocSizeOf for accountable_refcell::RefCell<T> {
|
impl<T: MallocSizeOf> MallocSizeOf for accountable_refcell::RefCell<T> {
|
||||||
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
|
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
|
||||||
self.borrow().size_of(ops)
|
self.borrow().size_of(ops)
|
||||||
|
|
|
@ -123,7 +123,6 @@ pub struct Image {
|
||||||
pub width: u32,
|
pub width: u32,
|
||||||
pub height: u32,
|
pub height: u32,
|
||||||
pub format: PixelFormat,
|
pub format: PixelFormat,
|
||||||
#[ignore_malloc_size_of = "Defined in webrender_api"]
|
|
||||||
pub id: Option<ImageKey>,
|
pub id: Option<ImageKey>,
|
||||||
pub cors_status: CorsStatus,
|
pub cors_status: CorsStatus,
|
||||||
pub frames: Vec<ImageFrame>,
|
pub frames: Vec<ImageFrame>,
|
||||||
|
@ -132,7 +131,6 @@ pub struct Image {
|
||||||
#[derive(Clone, Deserialize, MallocSizeOf, Serialize)]
|
#[derive(Clone, Deserialize, MallocSizeOf, Serialize)]
|
||||||
pub struct ImageFrame {
|
pub struct ImageFrame {
|
||||||
pub delay: Option<Duration>,
|
pub delay: Option<Duration>,
|
||||||
#[ignore_malloc_size_of = "Defined in ipc-channel"]
|
|
||||||
pub bytes: IpcSharedMemory,
|
pub bytes: IpcSharedMemory,
|
||||||
pub width: u32,
|
pub width: u32,
|
||||||
pub height: u32,
|
pub height: u32,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue