Skip to content

Commit c6d6157

Browse files
authored
Warn if memory pool is dropped with bytes still reserved (#1721)
1 parent eba52ee commit c6d6157

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

native/core/src/execution/memory_pools/unified_pool.rs

+9
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,15 @@ impl CometMemoryPool {
7676
}
7777
}
7878

79+
impl Drop for CometMemoryPool {
80+
fn drop(&mut self) {
81+
let used = self.used.load(Relaxed);
82+
if used != 0 {
83+
log::warn!("CometMemoryPool dropped with {} bytes still reserved", used);
84+
}
85+
}
86+
}
87+
7988
unsafe impl Send for CometMemoryPool {}
8089
unsafe impl Sync for CometMemoryPool {}
8190

0 commit comments

Comments
 (0)