| 171 | |
| 172 | impl<const N: usize> Drop for ThreadSampler<'_, N> { |
| 173 | fn drop(&mut self) { |
| 174 | let _result = self.stop(); |
| 175 | |
| 176 | let kpep_vt = self.sampler.kperfdata.vtable(); |
| 177 | // SAFETY: config was allocated by kpep_config_create in ll_start and |
| 178 | // has not been freed. The kperfdata framework is still loaded because |
| 179 | // we hold a reference to the Sampler which owns it. |
| 180 | unsafe { |
| 181 | (kpep_vt.kpep_config_free)(self.config.as_ptr()); |
| 182 | } |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | impl<const N: usize> fmt::Debug for ThreadSampler<'_, N> { |