about summary refs log tree commit diff
path: root/third_party/nix/src/tests/attr-set.cc
diff options
context:
space:
mode:
authorKane York <kanepyork@gmail.com>2020-08-13T22·18-0700
committerkanepyork <rikingcoding@gmail.com>2020-08-14T00·35+0000
commit72e61aa584c3e3bbafbdc539959a2db8e0f123ef (patch)
treed74d5ed8508ab9845812752c51451f870dcc482c /third_party/nix/src/tests/attr-set.cc
parentd4f5fcef66beeff2e0cbd641ac83a5b2a67e3006 (diff)
refactor(tvix): completely remove boehm gc r/1646
We have decided that leaking memory is a better fate than random,
non-debuggable memory corruption. Future CLs will begin changing
various fields to std::unique_ptr and std::shared_ptr.

It turns out that disabling the GC does not have disasterous impact.
The Nix evaluator only runs on the client CLI, never in any long-
running process. Even the REPL does not leak too badly under this
change, because it uses one EvalState for the duration of the REPL.

Building an explicitly tracing garbage collector is likely in the
future of this project, but that giant amount of work cannot be
done under a nix evaluator that is constantly crashing. We need to
restore development velocity here, and this is the best way we've
figured out to do it.

Change-Id: I2fcda8fcee853c15a9a5e22eca7c5a784bc2bf76
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1720
Reviewed-by: glittershark <grfn@gws.fyi>
Reviewed-by: tazjin <mail@tazj.in>
Tested-by: BuildkiteCI
Diffstat (limited to '')
-rw-r--r--third_party/nix/src/tests/attr-set.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/third_party/nix/src/tests/attr-set.cc b/third_party/nix/src/tests/attr-set.cc
index 17234f6b31..d52956f6ac 100644
--- a/third_party/nix/src/tests/attr-set.cc
+++ b/third_party/nix/src/tests/attr-set.cc
@@ -7,7 +7,6 @@
 
 #include <absl/container/btree_map.h>
 #include <bits/stdint-intn.h>
-#include <gc/gc_cpp.h>
 #include <gtest/gtest.h>
 #include <rapidcheck.h>
 #include <rapidcheck/Assertions.h>
@@ -55,7 +54,7 @@ struct Arbitrary<Value*> {
   static Gen<nix::Value*> arbitrary() {
     return gen::apply(
         [](nix::ValueType typ, int i) {
-          auto ret = new (GC) Value();
+          auto ret = new Value();
           ret->type = typ;
           ret->integer = i;
           return ret;
@@ -78,7 +77,7 @@ struct Arbitrary<nix::Pos*> {
   static Gen<nix::Pos*> arbitrary() {
     return gen::apply(
         [](unsigned int line, unsigned int column) {
-          return new (GC) Pos({}, line, column);
+          return new Pos({}, line, column);
         },
         gen::arbitrary<unsigned int>(), gen::arbitrary<unsigned int>());
   }