(deopt: &Deopt)
| 35 | } |
| 36 | |
| 37 | pub fn save_exec_counter(deopt: &Deopt) { |
| 38 | let counter_path: PathBuf = [ |
| 39 | deopt.get_library_misc_dir().unwrap(), |
| 40 | "exec_counter.json".into(), |
| 41 | ] |
| 42 | .iter() |
| 43 | .collect(); |
| 44 | let guard = EXEC_COUNTER.get_or_init(|| RwLock::new(HashMap::new())).read().unwrap(); |
| 45 | let json = serde_json::to_string(&*guard).unwrap(); |
| 46 | std::fs::write(counter_path, json).unwrap(); |
| 47 | } |
| 48 | |
| 49 | pub fn load_exec_counter(deopt: &Deopt) -> HashMap<String, u32> { |
| 50 | let counter_path: PathBuf = [ |
no test coverage detected