mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-25 23:36:16 +02:00
Don't move the arguments of the primOp
Moving arguments of the primOp into the registration structure makes it impossible to initialize a second EvalState with the correct primOp registration. It will end up registering all those "RegisterPrimOp"'s with an arity of zero on all but the 2nd instance of the EvalState. Not moving the memory will add a tiny bit of memory overhead during the eval since we need a copy of all the argument lists of all the primOp's. The overhead shouldn't be too bad as it is static (based on the amonut of registered operations) and only occurs once during the interpreter startup.
This commit is contained in:
parent
55275fcc59
commit
90d8178009
1 changed files with 1 additions and 1 deletions
|
@ -3732,7 +3732,7 @@ void EvalState::createBaseEnv()
|
||||||
.fun = primOp.fun,
|
.fun = primOp.fun,
|
||||||
.arity = std::max(primOp.args.size(), primOp.arity),
|
.arity = std::max(primOp.args.size(), primOp.arity),
|
||||||
.name = symbols.create(primOp.name),
|
.name = symbols.create(primOp.name),
|
||||||
.args = std::move(primOp.args),
|
.args = primOp.args,
|
||||||
.doc = primOp.doc,
|
.doc = primOp.doc,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue