pub enum StackLimit {
None,
Trap {
limit: GlobalValue,
},
Call {
limit: GlobalValue,
func: FuncRef,
},
}Expand description
The stack-limit check performed in a function’s prologue.
The limit is a global value which represents an expression evaluating to
the stack limit for this function. It is interpreted in the prologue, if
necessary, to check that the stack pointer does not go below the limit.
Variants§
None
No stack-limit check.
Trap
Trap with TrapCode::STACK_OVERFLOW when the check fails.
Fields
limit: GlobalValueThe stack limit.
Call
Tail-call a handler function when the check fails.
The stack-limit check is performed at the very start of the function, before any frame setup, and on overflow control is transferred to the handler with a tail call.
The handler must be colocated, must use the same calling
convention as this function, its parameters must be
“compatible” with this function’s parameters, and it must not
return (i.e., it should either abort or unwind somehow). A
“compatible” stack-overflow handler signature is defined as:
tail: parameters of the handler are a prefix of this function’s parameters, and neither this function nor the handler has a struct-return (sret) parameter. There are no restrictions on either signature’s return values.- other calling conventions: not supported.
Implementations§
Trait Implementations§
Source§impl Clone for StackLimit
impl Clone for StackLimit
impl Copy for StackLimit
Source§impl Debug for StackLimit
impl Debug for StackLimit
Source§impl Default for StackLimit
impl Default for StackLimit
Source§impl<'de> Deserialize<'de> for StackLimit
Available on crate feature enable-serde only.
impl<'de> Deserialize<'de> for StackLimit
enable-serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for StackLimit
Source§impl Hash for StackLimit
impl Hash for StackLimit
Source§impl PartialEq for StackLimit
impl PartialEq for StackLimit
Source§impl Serialize for StackLimit
Available on crate feature enable-serde only.
impl Serialize for StackLimit
enable-serde only.impl StructuralPartialEq for StackLimit
Auto Trait Implementations§
impl Forget for StackLimit
impl Freeze for StackLimit
impl Move for StackLimit
impl RefUnwindSafe for StackLimit
impl Send for StackLimit
impl Sync for StackLimit
impl Unpin for StackLimit
impl UnsafeUnpin for StackLimit
impl UnwindSafe for StackLimit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.