forge
Explore
Log in

Don't you dare go Hollow

pw_utils: Add Tracy spans to ShmMapping

Browse files at this commit

d5bc484df172c5aaf34e38a79b218ac41977c009Ivan MolodetskikhParent: 6b02f42
src/screencasting/pw_utils/shm_mapping.rsmodified+4 -0
@@ -37,6 +37,8 @@ impl ShmMapping {
3737 }
3838
3939 pub(super) fn copy_frame(&self, bytes: &[u8]) {
40+ let _span = tracy_client::span!();
41+
4042 // SAFETY: The constructor's contract keeps the memory valid and ensures
4143 // exclusive access during this write. No references into the mapping escape.
4244 let buffer = unsafe { slice::from_raw_parts_mut(self.address.cast::<u8>(), self.len) };
@@ -44,6 +46,8 @@ impl ShmMapping {
4446 }
4547
4648 pub(super) fn clear(&self) {
49+ let _span = tracy_client::span!();
50+
4751 // SAFETY: As in copy_frame, the mapping is valid and exclusively accessed.
4852 let buffer = unsafe { slice::from_raw_parts_mut(self.address.cast::<u8>(), self.len) };
4953 buffer.fill(0);