Skip to content

Commit e1bafce

Browse files
committed
Box signal_handlers to reduce size_of::<VirtualMachine>()
1 parent 5c10579 commit e1bafce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vm/src/vm.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ pub struct VirtualMachine {
6666
pub trace_func: RefCell<PyObjectRef>,
6767
pub use_tracing: Cell<bool>,
6868
pub recursion_limit: Cell<usize>,
69-
pub signal_handlers: Option<RefCell<[PyObjectRef; NSIG]>>,
69+
pub signal_handlers: Option<Box<RefCell<[PyObjectRef; NSIG]>>>,
7070
pub state: Arc<PyGlobalState>,
7171
pub initialized: bool,
7272
}
@@ -201,7 +201,7 @@ impl VirtualMachine {
201201
trace_func,
202202
use_tracing: Cell::new(false),
203203
recursion_limit: Cell::new(if cfg!(debug_assertions) { 256 } else { 512 }),
204-
signal_handlers: Some(signal_handlers),
204+
signal_handlers: Some(Box::new(signal_handlers)),
205205
state: Arc::new(PyGlobalState {
206206
settings,
207207
stdlib_inits,

0 commit comments

Comments
 (0)