re_byte_size/egui_sizes.rs
1use egui::emath;
2
3use crate::SizeBytes;
4
5impl<T: SizeBytes + Copy> SizeBytes for emath::History<T> {
6 fn heap_size_bytes(&self) -> u64 {
7 let s = std::mem::size_of::<(f64, T)>() as u64 * self.len() as u64;
8 if T::IS_POD {
9 s
10 } else {
11 s + self
12 .iter()
13 .map(|t: (f64, T)| t.heap_size_bytes())
14 .sum::<u64>()
15 }
16 }
17}