File: fix-hashbrown-allocation-size.patch

package info (click to toggle)
rust-salsa 0.23.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,492 kB
  • sloc: sh: 12; makefile: 2; javascript: 1
file content (15 lines) | stat: -rw-r--r-- 580 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Index: salsa/src/accumulator/accumulated_map.rs
===================================================================
--- salsa.orig/src/accumulator/accumulated_map.rs
+++ salsa/src/accumulator/accumulated_map.rs
@@ -52,7 +52,9 @@ impl AccumulatedMap {
     }
 
     pub fn allocation_size(&self) -> usize {
-        self.map.allocation_size()
+        // allocation_size() is not available in older hashbrown versions
+        // Return an approximation based on capacity
+        self.map.capacity() * std::mem::size_of::<(IngredientIndex, Box<dyn AnyAccumulated>)>()
     }
 }