Docs: Add phase_9_79b_3_vm_vtable_thunks_and_pic.md\n- Plan to formalize TypeMeta+Thunk and upgrade PIC to poly\n- Diagnostics, risks, milestones, exit criteria, and Phase 10 readiness

This commit is contained in:
Moe Charm
2025-08-27 00:03:48 +09:00
parent c0b70c0e4e
commit edf5ccfcb4
10 changed files with 313 additions and 21 deletions

View File

@ -0,0 +1,30 @@
//! Global cache version map for vtable/PIC invalidation
use once_cell::sync::Lazy;
use std::collections::HashMap;
use std::sync::Mutex;
static CACHE_VERSIONS: Lazy<Mutex<HashMap<String, u32>>> = Lazy::new(|| Mutex::new(HashMap::new()));
/// Get current version for a cache label (default 0)
pub fn get_version(label: &str) -> u32 {
let map = CACHE_VERSIONS.lock().unwrap();
*map.get(label).unwrap_or(&0)
}
/// Bump version for a cache label
pub fn bump_version(label: &str) {
let mut map = CACHE_VERSIONS.lock().unwrap();
let e = map.entry(label.to_string()).or_insert(0);
*e = e.saturating_add(1);
}
/// Convenience: bump for multiple labels
pub fn bump_many(labels: &[String]) {
let mut map = CACHE_VERSIONS.lock().unwrap();
for l in labels {
let e = map.entry(l.clone()).or_insert(0);
*e = e.saturating_add(1);
}
}