SourceExprCommand: allocate the vSourceExpr via uncollectable memory

Previously the memory would occasionally be collected during eval since
the GC doesn't consider the member variable as alive / doesn't scan the
region of memory where the pointer lives.

By using the traceable_allocator<T> allocator provided by Boehm GC we
can ensure the memory isn't collected. It should be properly freed when
SourceExprCommand goes out of scope.
This commit is contained in:
Andreas Rammhold
2020-04-13 21:23:54 +02:00
parent 512753f824
commit d2c371927e
2 changed files with 10 additions and 4 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ private:
std::shared_ptr<EvalState> evalState;
Value * vSourceExpr = 0;
std::shared_ptr<Value> vSourceExpr;
};
enum RealiseMode { Build, NoBuild, DryRun };