Skip to content

Commit

Permalink
Derive default for StackLimits
Browse files Browse the repository at this point in the history
  • Loading branch information
dhil committed Feb 16, 2024
1 parent f29fdda commit 4254dbe
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions crates/continuations/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,25 +33,14 @@ pub type ContinuationFiber = Fiber<'static, (), u32, ()>;
/// This type is used to save (and subsequently restore) a subset of the data in
/// `VMRuntimeLimits`. See documentation of `StackChain` for the exact uses.
#[repr(C)]
#[derive(Debug, Clone)]
#[derive(Debug, Default, Clone)]
pub struct StackLimits {
pub stack_limit: usize,
pub last_wasm_exit_fp: usize,
pub last_wasm_exit_pc: usize,
pub last_wasm_entry_sp: usize,
}

impl Default for StackLimits {
fn default() -> Self {
Self {
stack_limit: 0,
last_wasm_exit_fp: 0,
last_wasm_exit_pc: 0,
last_wasm_entry_sp: 0,
}
}
}

impl StackLimits {
pub fn with_stack_limit(stack_limit: usize) -> Self {
Self {
Expand Down

0 comments on commit 4254dbe

Please sign in to comment.