diff options
author | Andreas Rammhold <andreas@rammhold.de> | 2021-11-06 19:50:27 +0100 |
---|---|---|
committer | Andreas Rammhold <andreas@rammhold.de> | 2021-11-28 02:06:47 +0100 |
commit | 90d8178009381fe7ad6f0380127df2bc5a0d1dc9 (patch) | |
tree | 7fd8b0e31e1ab644a5020f00b1c32eb9142b6102 /src/libexpr/primops.cc | |
parent | 55275fcc5966cfad80fb6dc77b8d8939a2f1b8e0 (diff) |
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.
Diffstat (limited to 'src/libexpr/primops.cc')
-rw-r--r-- | src/libexpr/primops.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index c0d59da8c..d1f4d9009 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -3732,7 +3732,7 @@ void EvalState::createBaseEnv() .fun = primOp.fun, .arity = std::max(primOp.args.size(), primOp.arity), .name = symbols.create(primOp.name), - .args = std::move(primOp.args), + .args = primOp.args, .doc = primOp.doc, }); |