Make MallocSizeOf::malloc_{,enclosing_}size_of unsafe.

This fixes #18473.
This commit is contained in:
Nicholas Nethercote 2017-09-13 15:59:54 +10:00
parent cad3aff508
commit f83099f62a
3 changed files with 13 additions and 13 deletions

View file

@ -67,7 +67,7 @@ impl Drop for RuleTree {
#[cfg(feature = "gecko")]
impl MallocSizeOf for RuleTree {
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
let mut n = ops.malloc_size_of(self.root.ptr());
let mut n = unsafe { ops.malloc_size_of(self.root.ptr()) };
n += self.root.get().size_of(ops);
n
}
@ -806,7 +806,7 @@ impl MallocSizeOf for RuleNode {
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize {
let mut n = 0;
for child in self.iter_children() {
n += ops.malloc_size_of(child.ptr());
n += unsafe { ops.malloc_size_of(child.ptr()) };
n += unsafe { (*child.ptr()).size_of(ops) };
}
n