@@ -319,26 +319,29 @@ mod imp {
319
319
) ) ]
320
320
unsafe fn get_stack_start ( ) -> Option < * mut libc:: c_void > {
321
321
let mut ret = None ;
322
- let attr: mem:: MaybeUninit < libc:: pthread_attr_t > = if cfg ! ( target_os = "freebsd" ) {
322
+ let mut attr: mem:: MaybeUninit < libc:: pthread_attr_t > = if cfg ! ( target_os = "freebsd" ) {
323
323
let mut attr = mem:: MaybeUninit :: uninit ( ) ;
324
324
assert_eq ! ( libc:: pthread_attr_init( ( & raw mut attr) as * mut _) , 0 ) ;
325
325
attr
326
326
} else {
327
327
mem:: MaybeUninit :: zeroed ( )
328
328
} ;
329
- let mut attr = unsafe { attr . assume_init ( ) } ;
329
+
330
330
#[ cfg( target_os = "freebsd" ) ]
331
- let e = libc:: pthread_attr_get_np ( libc:: pthread_self ( ) , & mut attr) ;
331
+ let e = libc:: pthread_attr_get_np ( libc:: pthread_self ( ) , attr. as_mut_ptr ( ) ) ;
332
332
#[ cfg( not( target_os = "freebsd" ) ) ]
333
- let e = libc:: pthread_getattr_np ( libc:: pthread_self ( ) , & mut attr) ;
333
+ let e = libc:: pthread_getattr_np ( libc:: pthread_self ( ) , attr. as_mut_ptr ( ) ) ;
334
334
if e == 0 {
335
335
let mut stackaddr = crate :: ptr:: null_mut ( ) ;
336
336
let mut stacksize = 0 ;
337
- assert_eq ! ( libc:: pthread_attr_getstack( & attr, & mut stackaddr, & mut stacksize) , 0 ) ;
337
+ assert_eq ! (
338
+ libc:: pthread_attr_getstack( attr. as_ptr( ) , & mut stackaddr, & mut stacksize) ,
339
+ 0
340
+ ) ;
338
341
ret = Some ( stackaddr) ;
339
342
}
340
343
if e == 0 || cfg ! ( target_os = "freebsd" ) {
341
- assert_eq ! ( libc:: pthread_attr_destroy( & mut attr) , 0 ) ;
344
+ assert_eq ! ( libc:: pthread_attr_destroy( attr. as_mut_ptr ( ) ) , 0 ) ;
342
345
}
343
346
ret
344
347
}
0 commit comments