Nicer printing of frame refcount mismatch

This commit is contained in:
bjorn3
2025-09-26 23:27:41 +02:00
parent cd761ee679
commit 4db2c919ef
+6 -7
View File
@@ -153,16 +153,15 @@ pub unsafe fn debugger(target_id: Option<*const ContextLock>, token: &mut CleanL
assert!(p);
continue;
};
let rc = info.refcount();
let (c, s) = match rc {
None => (0, false),
Some(RefCount::One) => (1, false),
Some(RefCount::Cow(c)) => (c.get(), false),
Some(RefCount::Shared(s)) => (s.get(), true),
let (c, s) = match info.refcount() {
None => (0, ""),
Some(RefCount::One) => (1, ""),
Some(RefCount::Cow(c)) => (c.get(), " cow"),
Some(RefCount::Shared(s)) => (s.get(), " shared"),
};
if c != count {
println!(
"frame refcount mismatch for {:?} ({} != {} s {})",
"frame refcount mismatch for {:?} ({} != {}{})",
frame, c, count, s
);
}