about summary refs log tree commit diff
path: root/third_party
diff options
context:
space:
mode:
Diffstat (limited to 'third_party')
-rw-r--r--third_party/nix/src/libexpr/attr-set.hh9
1 files changed, 8 insertions, 1 deletions
diff --git a/third_party/nix/src/libexpr/attr-set.hh b/third_party/nix/src/libexpr/attr-set.hh
index caddc6bebd61..5837b5cbdc9c 100644
--- a/third_party/nix/src/libexpr/attr-set.hh
+++ b/third_party/nix/src/libexpr/attr-set.hh
@@ -2,10 +2,11 @@
 #pragma once
 
 #include <absl/container/btree_map.h>
+#include <gc/gc_allocator.h>
 
 #include "nixexpr.hh"
 #include "symbol-table.hh"
-#include "types.hh"  // TODO(tazjin): audit this include
+#include "types.hh"
 
 namespace nix {  // TODO(tazjin): ::expr
 
@@ -29,6 +30,12 @@ inline bool operator==(const Attr& lhs, const Attr& rhs) {
   return lhs.name == rhs.name;
 }
 
+// Convenience alias for the backing map, with the garbage-collecting
+// allocator explicitly specified.
+using AttributeMap =
+    absl::btree_map<Symbol, Attr, std::less<Symbol>,
+                    gc_allocator<std::pair<const Symbol, Attr>>>;
+
 class Bindings {
  public:
   typedef absl::btree_map<Symbol, Attr>::iterator iterator;