Skip to content

Commit

Permalink
unix: Unsafe-wrap stack_overflow::cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
workingjubilee committed Jul 17, 2024
1 parent 9ad696a commit c496f05
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion library/std/src/sys/pal/unix/stack_overflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,11 @@ mod imp {
mem::forget(handler);
}

/// # Safety
/// Must be called only once
#[forbid(unsafe_op_in_unsafe_fn)]
pub unsafe fn cleanup() {
drop_handler(MAIN_ALTSTACK.load(Ordering::Relaxed));
unsafe { drop_handler(MAIN_ALTSTACK.load(Ordering::Relaxed)) };
}

unsafe fn get_stack() -> libc::stack_t {
Expand Down

0 comments on commit c496f05

Please sign in to comment.