@@ -193,27 +193,6 @@ static Symbol getName(const AttrName & name, EvalState & state, Env & env)
193193
194194static constexpr size_t BASE_ENV_SIZE = 128 ;
195195
196- struct EvalState ::SrcToStore
197- {
198- boost::concurrent_flat_map<SourcePath, StorePath> inner;
199- };
200-
201- struct EvalState ::ImportResolutionCache
202- {
203- boost::concurrent_flat_map<SourcePath, SourcePath> inner;
204- };
205-
206- struct EvalState ::FileEvalCache
207- {
208- boost::concurrent_flat_map<
209- SourcePath,
210- Value *,
211- std::hash<SourcePath>,
212- std::equal_to<SourcePath>,
213- traceable_allocator<std::pair<const SourcePath, Value *>>>
214- inner;
215- };
216-
217196EvalState::EvalState (
218197 const LookupPath & lookupPathFromArguments,
219198 ref<Store> store,
@@ -286,9 +265,9 @@ EvalState::EvalState(
286265 , debugRepl(nullptr )
287266 , debugStop(false )
288267 , trylevel(0 )
289- , srcToStore(make_ref<SrcToStore >())
290- , importResolutionCache(make_ref<ImportResolutionCache >())
291- , fileEvalCache(make_ref<FileEvalCache >())
268+ , srcToStore(make_ref<decltype (srcToStore)::element_type >())
269+ , importResolutionCache(make_ref<decltype (importResolutionCache)::element_type >())
270+ , fileEvalCache(make_ref<decltype (fileEvalCache)::element_type >())
292271 , regexCache(makeRegexCache())
293272#if NIX_USE_BOEHMGC
294273 , valueAllocCache(std::allocate_shared<void *>(traceable_allocator<void *>(), nullptr ))
@@ -1100,14 +1079,14 @@ struct ExprParseFile : Expr
11001079
11011080void EvalState::evalFile (const SourcePath & path, Value & v, bool mustBeTrivial)
11021081{
1103- auto resolvedPath = getConcurrent (importResolutionCache-> inner , path);
1082+ auto resolvedPath = getConcurrent (* importResolutionCache, path);
11041083
11051084 if (!resolvedPath) {
11061085 resolvedPath = resolveExprPath (path);
1107- importResolutionCache->inner . emplace (path, *resolvedPath);
1086+ importResolutionCache->emplace (path, *resolvedPath);
11081087 }
11091088
1110- if (auto v2 = getConcurrent (fileEvalCache-> inner , *resolvedPath)) {
1089+ if (auto v2 = getConcurrent (* fileEvalCache, *resolvedPath)) {
11111090 forceValue (**v2, noPos);
11121091 v = **v2;
11131092 return ;
@@ -1116,7 +1095,7 @@ void EvalState::evalFile(const SourcePath & path, Value & v, bool mustBeTrivial)
11161095 Value * vExpr;
11171096 ExprParseFile expr{*resolvedPath, mustBeTrivial};
11181097
1119- fileEvalCache->inner . try_emplace_and_cvisit (
1098+ fileEvalCache->try_emplace_and_cvisit (
11201099 *resolvedPath,
11211100 nullptr ,
11221101 [&](auto & i) {
@@ -1133,8 +1112,8 @@ void EvalState::evalFile(const SourcePath & path, Value & v, bool mustBeTrivial)
11331112
11341113void EvalState::resetFileCache ()
11351114{
1136- fileEvalCache-> inner . clear ();
1137- fileEvalCache->inner . rehash ( 0 );
1115+ importResolutionCache-> clear ();
1116+ fileEvalCache->clear ( );
11381117 inputCache->clear ();
11391118}
11401119
@@ -2419,7 +2398,7 @@ StorePath EvalState::copyPathToStore(NixStringContext & context, const SourcePat
24192398 if (nix::isDerivation (path.path .abs ()))
24202399 error<EvalError>(" file names are not allowed to end in '%1%'" , drvExtension).debugThrow ();
24212400
2422- auto dstPathCached = getConcurrent (srcToStore-> inner , path);
2401+ auto dstPathCached = getConcurrent (* srcToStore, path);
24232402
24242403 auto dstPath = dstPathCached ? *dstPathCached : [&]() {
24252404 auto dstPath = fetchToStore (
@@ -2432,7 +2411,7 @@ StorePath EvalState::copyPathToStore(NixStringContext & context, const SourcePat
24322411 nullptr ,
24332412 repair);
24342413 allowPath (dstPath);
2435- srcToStore->inner . try_emplace (path, dstPath);
2414+ srcToStore->try_emplace (path, dstPath);
24362415 printMsg (lvlChatty, " copied source '%1%' -> '%2%'" , path, store->printStorePath (dstPath));
24372416 return dstPath;
24382417 }();
0 commit comments