AlexanderSaydakov commented on code in PR #340:
URL: https://github.com/apache/datasketches-cpp/pull/340#discussion_r1090988777


##########
sampling/include/var_opt_union_impl.hpp:
##########
@@ -554,11 +559,10 @@ void var_opt_union<T, 
A>::mark_moving_gadget_coercer(var_opt_sketch<T, A>& sk) c
   wts[result_h] = -1.0;
 
   // clean up arrays in input sketch, replace with new values
-  typedef typename std::allocator_traits<A>::template rebind_alloc<bool> 
AllocBool;
-  AllocBool().deallocate(sk.marks_, sk.curr_items_alloc_);
-  AllocDouble().deallocate(sk.weights_, sk.curr_items_alloc_);
-  for (size_t i = 0; i < result_k; ++i) { A().destroy(sk.data_ + i); } // 
assumes everything in H region, no gap
-  A().deallocate(sk.data_, sk.curr_items_alloc_);
+  AllocBool(allocator_).deallocate(sk.marks_, sk.curr_items_alloc_);
+  AllocDouble(allocator_).deallocate(sk.weights_, sk.curr_items_alloc_);
+  for (size_t i = 0; i < result_k; ++i) { sk.data_[i].~T(); } // assumes 
everything in H region, no gap
+  A(allocator_).deallocate(sk.data_, sk.curr_items_alloc_);

Review Comment:
   allocator_.deallocate() perhaps?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to