traceable_allocator

This commit is contained in:
Ben Burdette 2022-05-05 20:26:10 -06:00
parent f400c5466d
commit dea998b2f2
3 changed files with 7 additions and 3 deletions

View file

@ -276,6 +276,6 @@ void printClosureDiff(
void runRepl( void runRepl(
ref<EvalState> evalState, ref<EvalState> evalState,
const Expr & expr, const Expr & expr,
const std::map<std::string, Value *> & extraEnv); const ValMap & extraEnv);
} }

View file

@ -1016,7 +1016,7 @@ std::ostream & NixRepl::printValue(std::ostream & str, Value & v, unsigned int m
void runRepl( void runRepl(
ref<EvalState> evalState, ref<EvalState> evalState,
const Expr &expr, const Expr &expr,
const std::map<std::string, Value *> & extraEnv) const ValMap & extraEnv)
{ {
auto repl = std::make_unique<NixRepl>(evalState); auto repl = std::make_unique<NixRepl>(evalState);

View file

@ -37,7 +37,11 @@ struct PrimOp
const char * doc = nullptr; const char * doc = nullptr;
}; };
typedef std::map<std::string, Value *> ValMap; #if HAVE_BOEHMGC
typedef std::map<std::string, Value *, std::less<std::string>, traceable_allocator<std::pair<const std::string, Value *> > > ValMap;
#else
typedef std::map<std::string, Value *> ValMap;
#endif
struct Env struct Env
{ {