Skip to content

Commit 5c25b9a

Browse files
committed
graph: Fix bug in CacheWeight.weight
The bug made any struct have the size of a pointer, i.e., 8 bytes on 64 bit machines.
1 parent 6e9eee7 commit 5c25b9a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

graph/src/util/cache_weight.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::{collections::BTreeMap, mem};
99
pub trait CacheWeight {
1010
/// Total weight of the value.
1111
fn weight(&self) -> usize {
12-
mem::size_of_val(&self) + self.indirect_weight()
12+
mem::size_of_val(self) + self.indirect_weight()
1313
}
1414

1515
/// The weight of values pointed to by this value but logically owned by it, which is not

0 commit comments

Comments
 (0)