File tree 2 files changed +2
-4
lines changed
2 files changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ psm_stack_manipulation! {
154
154
// `StackRestoreGuard` allocates a memory area with suitable size and alignment.
155
155
// It also sets up stack guards if supported on target.
156
156
let guard = StackRestoreGuard :: new( requested_stack_size) ;
157
- let ( stack_base, allocated_stack_size) = guard. stack_area( ) ;
157
+ let ( stack_base, allocated_stack_size) = guard. stack_area( ) ;
158
158
debug_assert!( allocated_stack_size >= requested_stack_size) ;
159
159
set_stack_limit( Some ( stack_base as usize ) ) ;
160
160
// TODO should we not pass `allocated_stack_size` here?
Original file line number Diff line number Diff line change @@ -23,8 +23,6 @@ impl StackRestoreGuard {
23
23
. checked_mul ( page_size)
24
24
. expect ( "unreasonably large stack requested" ) ;
25
25
26
- // Next, there are a couple of approaches to how we allocate the new stack. If it is
27
- // available, we take the most obvious path and use `mmap`.
28
26
unsafe {
29
27
let new_stack = libc:: mmap (
30
28
std:: ptr:: null_mut ( ) ,
@@ -47,7 +45,7 @@ impl StackRestoreGuard {
47
45
old_stack_limit : get_stack_limit ( ) ,
48
46
} ;
49
47
// We leave a guard page without read/write access in our allocation.
50
- // TODO we allocated two extra pages for guard pages, but here we only use one?
48
+ // There is one guard page below the stack and another above it.
51
49
let above_guard_page = new_stack. add ( page_size) ;
52
50
#[ cfg( not( target_os = "openbsd" ) ) ]
53
51
let result = libc:: mprotect (
You can’t perform that action at this time.
0 commit comments