Call destructor for non-trivial destructors if arena allocator is used in ConcurrentS...
[folly.git] / folly / ConcurrentSkipList-inl.h
index befa0c9524ac230e216549d9ccf008ca49c29b86..48e3f63f3d86b107f70ffeba4caefaac98c837c9 100644 (file)
@@ -73,7 +73,7 @@ class SkipListNode : private boost::noncopyable {
   template<typename NodeAlloc>
   static constexpr bool destroyIsNoOp() {
     return IsArenaAllocator<NodeAlloc>::value &&
-           boost::has_trivial_destructor<std::atomic<SkipListNode*>>::value;
+           boost::has_trivial_destructor<SkipListNode>::value;
   }
 
   // copy the head node to a new head node assuming lock acquired
@@ -236,6 +236,8 @@ class NodeRecycler<NodeType, NodeAlloc, typename std::enable_if<
   explicit NodeRecycler(const NodeAlloc& alloc)
     : refs_(0), dirty_(false), alloc_(alloc) { lock_.init(); }
 
+  explicit NodeRecycler() : refs_(0), dirty_(false) { lock_.init(); }
+
   ~NodeRecycler() {
     CHECK_EQ(refs(), 0);
     if (nodes_) {