pub unsafe fn push_stack<T>(&mut self, arg: T) 
        where T: Send {

        // Alignment must be power of two. This should be guaranteed, but I
        // didn't see that the Rust docs guarantee it.
        let align = mem::align_of::<T>();
        debug_assert_eq!(align & (align - 1), 0);

        // Subtract size
        self.registers.rsp -= mem::size_of::<T>();

        // Align downward
        self.registers.rsp &= !(align - 1);

        // Put the value in
        *(self.registers.rsp as *mut T) = arg;
    }
/// Push a value onto the stack. The stack pointer advanced by the size of
/// `T` and then aligned as required for `T`.
///
/// Because the value will be sent to another thread, it must be `Send`.
///
/// # Unsafety
///
/// As this modifies the kernel stack directly, this could cause a violation
/// of expectations. It's up to the caller to ensure the instruction pointer
/// is set to a place that can handle the argument passed.
///
/// The kernel stack set must also be mapped to valid, nonoverlapping
/// memory.
Push a value onto the stack. The stack pointer advanced by the size of
`T` and then aligned as required for `T`.

Because the value will be sent to another thread, it must be `Send`.
Push a value onto the stack . The stack pointer advanced by the size of ` T ` and then aligned as required for ` T ` . Because the value will be sent to another thread it must be ` Send ` .
pub unsafe fn push_stack<T>(&mut self, arg: T) 
        where T: Send {
        // Alignment must be power of two. This should be guaranteed, but I
        // didn't see that the Rust docs guarantee it.
        let align = mem::align_of::<T>();
        debug_assert_eq!(align & (align - 1), 0);
        // Subtract size
        self.registers.rsp -= mem::size_of::<T>();
        // Align downward
        self.registers.rsp &= !(align - 1);
        // Put the value in
        *(self.registers.rsp as *mut T) = arg;
    }
pub unsafe fn push_stack < T > ( & mut self , arg : T ) where T : Send { // Alignment must be power of two. This should be guaranteed, but I // didn't see that the Rust docs guarantee it. let align = mem :: align_of :: < T > ( ) ; debug_assert_eq ! ( align ( align 1 ) 0 ) ; // Subtract size self . registers . rsp -= mem :: size_of :: < T > ( ) ; // Align downward self . registers . rsp &= ! ( align - 1 ) ; // Put the value in * ( self . registers . rsp as * mut T ) = arg ; }
Push a value onto the stack.
Push a value onto the stack .
&mut self
arg
T
unsafety
As this modifies the kernel stack directly, this could cause a violation
of expectations. It's up to the caller to ensure the instruction pointer
is set to a place that can handle the argument passed.

The kernel stack set must also be mapped to valid, nonoverlapping
memory.
As this modifies the kernel stack directly this could cause a violation of expectations . It ' s up to the caller to ensure the instruction pointer is set to a place that can handle the argument passed . The kernel stack set must also be mapped to valid nonoverlapping memory .