We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0cbcb17 commit 67068f3Copy full SHA for 67068f3
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