We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c1cda01 + 67068f3 commit 0ee1177Copy full SHA for 0ee1177
src/libstd/sys/unix/thread.rs
@@ -255,8 +255,9 @@ pub mod guard {
255
256
#[cfg(target_os = "macos")]
257
unsafe fn get_stack_start() -> Option<*mut libc::c_void> {
258
- let stackaddr = libc::pthread_get_stackaddr_np(libc::pthread_self()) as usize
259
- - libc::pthread_get_stacksize_np(libc::pthread_self());
+ let th = libc::pthread_self();
+ let stackaddr =
260
+ libc::pthread_get_stackaddr_np(th) as usize - libc::pthread_get_stacksize_np(th);
261
Some(stackaddr as *mut libc::c_void)
262
}
263
0 commit comments