Skip to content

Commit 52b94f9

Browse files
committed
Add some comments around various calls
Per review from workingjubilee
1 parent 82e954c commit 52b94f9

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

src/backtrace/win64.rs

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ pub unsafe fn trace(cb: &mut dyn FnMut(&super::Frame) -> bool) {
8080
use core::ptr;
8181

8282
// Capture the initial context to start walking from.
83+
// FIXME: shouldn't this have a Default impl?
8384
let mut context = unsafe { core::mem::zeroed::<MyContext>() };
8485
unsafe { RtlCaptureContext(&mut context.0) };
8586

src/symbolize/gimli.rs

+1
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ pub unsafe fn resolve(what: ResolveWhat<'_>, cb: &mut dyn FnMut(&super::Symbol))
439439
// Extend the lifetime of `sym` to `'static` since we are unfortunately
440440
// required to here, but it's only ever going out as a reference so no
441441
// reference to it should be persisted beyond this frame anyway.
442+
// SAFETY: praying the above is correct
442443
let sym = unsafe { mem::transmute::<Symbol<'_>, Symbol<'static>>(sym) };
443444
(cb)(&super::Symbol { inner: sym });
444445
};

src/symbolize/gimli/libs_windows.rs

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ unsafe fn add_loaded_images(ret: &mut Vec<Library>) {
2424
return;
2525
}
2626

27+
// huge struct, probably should avoid manually initializing it even if we can
2728
let mut me = MaybeUninit::<MODULEENTRY32W>::zeroed().assume_init();
2829
me.dwSize = mem::size_of_val(&me) as u32;
2930
if Module32FirstW(snap, &mut me) == TRUE {

0 commit comments

Comments
 (0)