Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions src/libexpr/eval.cc
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,6 @@ EvalMemory::EvalMemory()
assertGCInitialized();
}

Value * EvalMemory::allocInt(NixInt::Inner n)
{
if (n >= 0 && n < (NixInt::Inner) Value::vSmallInts.size())
return &Value::vSmallInts[n];
Value * v = allocValue();
v->mkInt(NixInt(n));
return v;
}

EvalState::EvalState(
const LookupPath & lookupPathFromArguments,
ref<Store> store,
Expand Down
2 changes: 0 additions & 2 deletions src/libexpr/include/nix/expr/eval.hh
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,6 @@ public:
return stats;
}

Value * allocInt(NixInt::Inner n);

/**
* Storage for the AST nodes
*/
Expand Down
7 changes: 0 additions & 7 deletions src/libexpr/include/nix/expr/value.hh
Original file line number Diff line number Diff line change
Expand Up @@ -1016,13 +1016,6 @@ struct Value : public ValueStorage<sizeof(void *)>
*/
static Value vFalse;

/**
* Small pre-allocated integer constants.
*
* These are _not_ singletons. Pointer equality is _not_ sufficient.
*/
static std::array<Value, 32> vSmallInts;

private:
template<InternalType... discriminator>
bool isa() const noexcept
Expand Down
10 changes: 7 additions & 3 deletions src/libexpr/primops.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3161,7 +3161,8 @@ static struct LazyPosAccessors

void operator()(EvalState & state, const PosIdx pos, Value & line, Value & column)
{
auto posV = state.mem.allocInt(pos.id);
Value * posV = state.allocValue();
posV->mkInt(pos.id);
line.mkApp(&lineOfPos, posV);
column.mkApp(&columnOfPos, posV);
}
Expand Down Expand Up @@ -3965,8 +3966,11 @@ static void prim_genList(EvalState & state, const PosIdx pos, Value ** args, Val
state.forceFunction(*args[0], noPos, "while evaluating the first argument passed to builtins.genList");

auto list = state.buildList(len);
for (const auto & [n, v] : enumerate(list))
(v = state.allocValue())->mkApp(args[0], state.mem.allocInt(n));
for (const auto & [n, v] : enumerate(list)) {
auto arg = state.allocValue();
arg->mkInt(n);
(v = state.allocValue())->mkApp(args[0], arg);
}
v.mkList(list);
}

Expand Down
44 changes: 0 additions & 44 deletions src/libexpr/primops/imap.cc

This file was deleted.

1 change: 0 additions & 1 deletion src/libexpr/primops/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ sources += files(
'fetchMercurial.cc',
'fetchTree.cc',
'fromTOML.cc',
'imap.cc',
)
7 changes: 0 additions & 7 deletions src/libexpr/value.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,4 @@ Value Value::vFalse = []() {
return res;
}();

std::array<Value, 32> Value::vSmallInts = []() {
decltype(Value::vSmallInts) arr;
for (size_t i = 0; i < arr.size(); ++i)
arr[i].mkInt(i);
return arr;
}();

} // namespace nix
1 change: 0 additions & 1 deletion tests/functional/lang/eval-okay-imap.exp

This file was deleted.

8 changes: 0 additions & 8 deletions tests/functional/lang/eval-okay-imap.nix

This file was deleted.

Loading