File tree Expand file tree Collapse file tree 4 files changed +7
-15
lines changed Expand file tree Collapse file tree 4 files changed +7
-15
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,6 @@ GLOBAL(__stacker_stack_pointer):
6
6
mov %esp , %eax
7
7
ret
8
8
9
- GLOBAL(__stacker_black_box):
10
- ret
11
-
12
9
GLOBAL(__stacker_switch_stacks):
13
10
// CFI instructions tells the unwinder how to unwind this function
14
11
// This enables unwinding through our extended stacks and also
Original file line number Diff line number Diff line change 1
1
#include <windows.h>
2
2
3
- void __stacker_black_box () {}
4
-
5
3
PVOID __stacker_get_current_fiber () {
6
4
return GetCurrentFiber ();
7
5
}
Original file line number Diff line number Diff line change 2
2
3
3
.text
4
4
5
- GLOBAL(__stacker_black_box):
6
- ret
7
5
GLOBAL(__stacker_stack_pointer):
8
6
movq %rsp , %rax
9
7
ret
Original file line number Diff line number Diff line change @@ -3,19 +3,18 @@ extern crate stacker;
3
3
use std:: sync:: mpsc;
4
4
use std:: thread;
5
5
6
- extern {
7
- fn __stacker_black_box ( t : * const u8 ) ;
8
- }
6
+ #[ inline( never) ]
7
+ fn __stacker_black_box ( _: * const u8 ) { }
9
8
10
9
#[ test]
11
10
fn deep ( ) {
12
11
fn foo ( n : usize , s : & mut [ u8 ] ) {
13
- unsafe { __stacker_black_box ( s. as_ptr ( ) ) ; }
12
+ __stacker_black_box ( s. as_ptr ( ) ) ;
14
13
if n > 0 {
15
14
stacker:: maybe_grow ( 64 * 1024 , 1024 * 1024 , || {
16
15
let mut s = [ 0u8 ; 1024 ] ;
17
16
foo ( n - 1 , & mut s) ;
18
- unsafe { __stacker_black_box ( s. as_ptr ( ) ) ; }
17
+ __stacker_black_box ( s. as_ptr ( ) ) ;
19
18
} )
20
19
} else {
21
20
println ! ( "bottom" ) ;
@@ -28,12 +27,12 @@ fn deep() {
28
27
#[ test]
29
28
fn panic ( ) {
30
29
fn foo ( n : usize , s : & mut [ u8 ] ) {
31
- unsafe { __stacker_black_box ( s. as_ptr ( ) ) ; }
30
+ __stacker_black_box ( s. as_ptr ( ) ) ;
32
31
if n > 0 {
33
32
stacker:: maybe_grow ( 64 * 1024 , 1024 * 1024 , || {
34
33
let mut s = [ 0u8 ; 1024 ] ;
35
34
foo ( n - 1 , & mut s) ;
36
- unsafe { __stacker_black_box ( s. as_ptr ( ) ) ; }
35
+ __stacker_black_box ( s. as_ptr ( ) ) ;
37
36
} )
38
37
} else {
39
38
panic ! ( "bottom" ) ;
@@ -84,4 +83,4 @@ fn catch_panic_leaf() {
84
83
let panic_result = std:: panic:: catch_unwind ( || panic ! ( ) ) ;
85
84
assert ! ( panic_result. is_err( ) ) ;
86
85
} ) ;
87
- }
86
+ }
You can’t perform that action at this time.
0 commit comments