diff --git a/lib/runtime-core/src/fault.rs b/lib/runtime-core/src/fault.rs index 248ad1c79..86b65f6ed 100644 --- a/lib/runtime-core/src/fault.rs +++ b/lib/runtime-core/src/fault.rs @@ -27,6 +27,8 @@ pub(crate) unsafe fn run_on_alternative_stack(stack_end: *mut u64, stack_begin: raw::run_on_alternative_stack(stack_end, stack_begin) } +const TRAP_STACK_SIZE: usize = 1048576; // 1MB + const SETJMP_BUFFER_LEN: usize = 27; type SetJmpBuffer = [i32; SETJMP_BUFFER_LEN]; @@ -173,7 +175,7 @@ extern "C" fn signal_trap_handler( let mut unwind_result: Box = Box::new(()); - let should_unwind = allocate_and_run(1048576, || { + let should_unwind = allocate_and_run(TRAP_STACK_SIZE, || { let mut is_suspend_signal = false; match Signal::from_c_int(signum) { diff --git a/lib/runtime-core/src/state.rs b/lib/runtime-core/src/state.rs index 4bb7e6d65..841e3deee 100644 --- a/lib/runtime-core/src/state.rs +++ b/lib/runtime-core/src/state.rs @@ -104,7 +104,6 @@ impl ModuleStateMap { if ip < base || ip - base >= self.total_size { None } else { - //println!("lookup ip: {} in {:?}", ip - base, self.local_functions); let (_, fsm) = self .local_functions .range((Unbounded, Included(&(ip - base)))) @@ -126,7 +125,6 @@ impl ModuleStateMap { if ip < base || ip - base >= self.total_size { None } else { - //println!("lookup ip: {} in {:?}", ip - base, self.local_functions); let (_, fsm) = self .local_functions .range((Unbounded, Included(&(ip - base)))) @@ -144,7 +142,6 @@ impl ModuleStateMap { if ip < base || ip - base >= self.total_size { None } else { - //println!("lookup ip: {} in {:?}", ip - base, self.local_functions); let (_, fsm) = self .local_functions .range((Unbounded, Included(&(ip - base))))