You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by al...@apache.org on 2020/10/27 00:21:44 UTC

[incubator-datasketches-cpp] branch req_sketch updated: pass allocator

This is an automated email from the ASF dual-hosted git repository.

alsay pushed a commit to branch req_sketch
in repository https://gitbox.apache.org/repos/asf/incubator-datasketches-cpp.git


The following commit(s) were added to refs/heads/req_sketch by this push:
     new 952e8bc  pass allocator
952e8bc is described below

commit 952e8bcfc443f639545380d724b0405f75262bd0
Author: AlexanderSaydakov <Al...@users.noreply.github.com>
AuthorDate: Mon Oct 26 17:21:34 2020 -0700

    pass allocator
---
 req/include/req_sketch.hpp      | 2 +-
 req/include/req_sketch_impl.hpp | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/req/include/req_sketch.hpp b/req/include/req_sketch.hpp
index 53039aa..f97c0c4 100755
--- a/req/include/req_sketch.hpp
+++ b/req/include/req_sketch.hpp
@@ -41,7 +41,7 @@ typename Allocator
 >
 class req_compactor {
 public:
-  req_compactor(uint8_t lg_weight, uint32_t section_size);
+  req_compactor(uint8_t lg_weight, uint32_t section_size, const Allocator& allocator);
 
   bool is_sorted() const;
   uint32_t get_num_items() const;
diff --git a/req/include/req_sketch_impl.hpp b/req/include/req_sketch_impl.hpp
index 30c2a86..132eeed 100755
--- a/req/include/req_sketch_impl.hpp
+++ b/req/include/req_sketch_impl.hpp
@@ -29,7 +29,7 @@
 namespace datasketches {
 
 template<typename T, bool H, typename C, typename A>
-req_compactor<T, H, C, A>::req_compactor(uint8_t lg_weight, uint32_t section_size):
+req_compactor<T, H, C, A>::req_compactor(uint8_t lg_weight, uint32_t section_size, const A& allocator):
 lg_weight_(lg_weight),
 coin_(false),
 sorted_(true),
@@ -37,7 +37,8 @@ section_size_raw_(section_size),
 section_size_(section_size),
 num_sections_(req_constants::INIT_NUM_SECTIONS),
 num_compactions_(0),
-state_(0)
+state_(0),
+items_(allocator)
 {}
 
 template<typename T, bool H, typename C, typename A>
@@ -201,7 +202,7 @@ void req_sketch<T, H, C, S, A>::update(FwdT&& item) {
 template<typename T, bool H, typename C, typename S, typename A>
 void req_sketch<T, H, C, S, A>::grow() {
   const uint8_t lg_weight = get_num_levels();
-  compactors_.push_back(Compactor(lg_weight, k_));
+  compactors_.push_back(Compactor(lg_weight, k_, allocator_));
   update_max_nom_size();
 }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org