Fix a panic in Stylo memory reporting.

`MallocSizeOfOps::enclosing_size_of_op` is an `Option<>` type, and the panic in
question is caused by not providing a value in a case where it's needed for
measuring a HashSet.

HashMaps and HashSets are common enough that it makes sense to make
`enclosing_size_of_op` non-optional, which this patch does.
This commit is contained in:
Nicholas Nethercote 2017-09-18 13:37:53 +10:00
parent 280ccf685d
commit 09143e627b
3 changed files with 20 additions and 11 deletions

View file

@ -1898,7 +1898,10 @@ extern "C" {
pub fn Servo_Element_ClearData(node: RawGeckoElementBorrowed);
}
extern "C" {
pub fn Servo_Element_SizeOfExcludingThisAndCVs(arg1: MallocSizeOf,
pub fn Servo_Element_SizeOfExcludingThisAndCVs(malloc_size_of:
MallocSizeOf,
malloc_enclosing_size_of:
MallocSizeOf,
seen_ptrs: *mut SeenPtrs,
node:
RawGeckoElementBorrowed)
@ -1964,6 +1967,8 @@ extern "C" {
}
extern "C" {
pub fn Servo_StyleSheet_SizeOfIncludingThis(malloc_size_of: MallocSizeOf,
malloc_enclosing_size_of:
MallocSizeOf,
sheet:
RawServoStyleSheetContentsBorrowed)
-> usize;