fix(tvix/eval): allocate Thunk::upvalues with known capacity
The capacity (i.e. number of builtins) is known from the lambda, so we can size it correctly right away. Change-Id: Iab0b5a3f47d450fa9866c091ebbbed935b934907 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6351 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
This commit is contained in:
parent
6c895d4b28
commit
a8c13a5ce1
1 changed files with 1 additions and 1 deletions
|
@ -51,8 +51,8 @@ pub struct Thunk(Rc<RefCell<ThunkRepr>>);
|
||||||
impl Thunk {
|
impl Thunk {
|
||||||
pub fn new(lambda: Rc<Lambda>) -> Self {
|
pub fn new(lambda: Rc<Lambda>) -> Self {
|
||||||
Thunk(Rc::new(RefCell::new(ThunkRepr::Suspended {
|
Thunk(Rc::new(RefCell::new(ThunkRepr::Suspended {
|
||||||
|
upvalues: Vec::with_capacity(lambda.upvalue_count),
|
||||||
lambda,
|
lambda,
|
||||||
upvalues: vec![],
|
|
||||||
})))
|
})))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue