From f7a85c5060301bcbd2fb71881de8b65226cacd81 Mon Sep 17 00:00:00 2001 From: Kane York Date: Sat, 1 Aug 2020 14:11:53 -0700 Subject: fix(3p/nix/expr): use traceable_allocator for btree_map The prior use of gc_allocator meant that the btree nodes themselves were being collected. Additionally, have Attr (contains a Value) and Bindings explicitly inherit from gc, even though Bindings is always allocated under `new (GC)`. Detected by running under GC_ENABLE_INCREMENTAL=1. Change-Id: Iacf13b34b5aa12e417ea87c9b46e2bf9199fdb26 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1544 Reviewed-by: glittershark Tested-by: BuildkiteCI --- third_party/nix/src/libexpr/attr-set.hh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'third_party/nix/src/libexpr') diff --git a/third_party/nix/src/libexpr/attr-set.hh b/third_party/nix/src/libexpr/attr-set.hh index b918bf30ffd2..a9db0db85644 100644 --- a/third_party/nix/src/libexpr/attr-set.hh +++ b/third_party/nix/src/libexpr/attr-set.hh @@ -14,7 +14,7 @@ class EvalState; struct Value; /* Map one attribute name to its value. */ -struct Attr { +struct Attr : public gc { Symbol name; Value* value; // TODO(tazjin): Who owns this? Pos* pos; // TODO(tazjin): Who owns this? @@ -26,9 +26,9 @@ struct Attr { // allocator explicitly specified. using AttributeMap = absl::btree_map, - gc_allocator>>; + traceable_allocator>>; -class Bindings { +class Bindings : public gc { public: typedef AttributeMap::iterator iterator; -- cgit 1.4.1