Skip to content

Commit ccd7b44

Browse files
stepanchegfacebook-github-bot
authored andcommitted
Store stack in a box
Summary: Need to make stack resizable. Resizable means extra indirection. Add indirection now to check there's no perf regression. Reviewed By: JakobDegen Differential Revision: D48955721 fbshipit-source-id: 2769d2845839f00af2c08f707434c55423ed9538
1 parent fd1f908 commit ccd7b44

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

starlark/src/eval/runtime/cheap_call_stack.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,19 @@ enum CallStackError {
8282
#[derive(Debug)]
8383
pub(crate) struct CheapCallStack<'v> {
8484
count: usize,
85-
stack: [CheapFrame<'v>; MAX_CALLSTACK_RECURSION],
85+
stack: Box<[CheapFrame<'v>; MAX_CALLSTACK_RECURSION]>,
8686
}
8787

8888
impl<'v> Default for CheapCallStack<'v> {
8989
fn default() -> Self {
9090
Self {
9191
count: 0,
92-
stack: [CheapFrame {
93-
function: Value::new_none(),
94-
span: None,
95-
}; MAX_CALLSTACK_RECURSION],
92+
stack: Box::new(
93+
[CheapFrame {
94+
function: Value::new_none(),
95+
span: None,
96+
}; MAX_CALLSTACK_RECURSION],
97+
),
9698
}
9799
}
98100
}

0 commit comments

Comments
 (0)