Skip to content

Commit 22517e8

Browse files
committed
graph: Round BigInt cache weight up to full bytes
Use ceiling division when converting bit length to bytes so values whose bit width is not a multiple of eight are not undercounted for cache accounting.
1 parent f031138 commit 22517e8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

graph/src/util/cache_weight.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ impl CacheWeight for BigDecimal {
140140

141141
impl CacheWeight for BigInt {
142142
fn indirect_weight(&self) -> usize {
143-
self.bits() / 8
143+
(self.bits() + 7) / 8
144144
}
145145
}
146146

0 commit comments

Comments
 (0)