From 3dbad0c087fea07c502364aa352f45ae7e21cb5d Mon Sep 17 00:00:00 2001 From: Simon Gog Date: Thu, 12 Sep 2013 09:23:54 +1000 Subject: [PATCH 1/7] Parameter is unused when no hugepages are used. --- include/sdsl/memory_management.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sdsl/memory_management.hpp b/include/sdsl/memory_management.hpp index 32ba22d8e..7eb48acf5 100644 --- a/include/sdsl/memory_management.hpp +++ b/include/sdsl/memory_management.hpp @@ -136,7 +136,7 @@ class hugepage_allocator mm_block_t* last_block(); void print_heap(); public: - void init(size_t size_in_bytes) { + void init(SDSL_UNUSED size_t size_in_bytes) { #ifdef MAP_HUGETLB m_total_size = size_in_bytes; m_base = (uint8_t*) mmap(nullptr, m_total_size, From 535591c06fa80a79eb6b32206951c5e11cfce8c8 Mon Sep 17 00:00:00 2001 From: Simon Gog Date: Thu, 12 Sep 2013 09:58:26 +1000 Subject: [PATCH 2/7] Use memory_manager now. --- .../indexing_count/src/run_queries_sdsl.cpp | 178 ++---------------- 1 file changed, 17 insertions(+), 161 deletions(-) diff --git a/benchmark/indexing_count/src/run_queries_sdsl.cpp b/benchmark/indexing_count/src/run_queries_sdsl.cpp index d3f881542..94999b40a 100644 --- a/benchmark/indexing_count/src/run_queries_sdsl.cpp +++ b/benchmark/indexing_count/src/run_queries_sdsl.cpp @@ -26,10 +26,7 @@ using namespace std; /* local headers */ void do_count(const CSA_TYPE&); void do_locate(const CSA_TYPE&); -//void do_extract (void); -//void do_display(ulong length); void pfile_info(ulong* length, ulong* numpatt); -//void output_char(uchar c, FILE * where); double getTime(void); void usage(char* progname); @@ -52,12 +49,26 @@ int main(int argc, char* argv[]) filename = argv[1]; querytype = *argv[2]; + string index_file = string(argv[1]) + "." + string(SUF); + bool mapped = false; +#ifdef USE_HP + uint64_t index_size = util::file_size(index_file); + // allocate hugepages, add 10 MiB + 3% overhead + uint64_t alloc_size = (uint64_t)(index_size*0.03+(1ULL<<20)*10); + try { + memory_manager::use_hugepages(alloc_size); + mapped = true; + } catch (...) { + std::cout<<"Unable to allocate "< 3) - if (*argv[3] == VERBOSE) { - Verbose = 1; - fprintf(stdout,"%c", EXTRACT); - } - - do_extract(); - break; - case DISPLAY: - if (argc < 4) { - usage(argv[0]); - exit (1); - } - if (argc > 4) - if (*argv[4] == VERBOSE){ - Verbose = 1; - fprintf(stdout,"%c", DISPLAY); - - } - do_display((ulong) atol(argv[3])); - break; - */ default: + default: fprintf(stderr, "Unknow option: main ru\n"); exit(1); } -#ifdef USE_HP - if (mapped) { - mm::unmap_hp(); - } -#endif return 0; } @@ -235,80 +216,6 @@ do_locate(const CSA_TYPE& csa) free(pattern); } - -/* -void do_display(ulong numc) { - - int error = 0; - ulong numocc, length, i, *snippet_len, tot_numcharext = 0, numpatt; - double time, tot_time = 0; - uchar *pattern, *snippet_text; - - pfile_info (&length, &numpatt); - - pattern = (uchar *) malloc (sizeof (uchar) * (length)); - if (pattern == NULL) - { - fprintf (stderr, "Error: cannot allocate\n"); - exit (1); - } - - fprintf(stderr, "Snippet length %lu\n", numc); - - while (numpatt) - { - - if (fread (pattern, sizeof (*pattern), length, stdin) != length) - { - fprintf (stderr, "Error: cannot read patterns file\n"); - perror ("run_queries"); - exit (1); - } - - // Display - time = getTime (); - error = display (Index, pattern, length, numc, &numocc, - &snippet_text, &snippet_len); - IFERROR (error); - tot_time += (getTime () - time); - - if (Verbose) { - ulong j, len = length + 2*numc; - char blank = '\0'; - fwrite(&length, sizeof(length), 1, stdout); - fwrite(pattern, sizeof(*pattern), length, stdout); - fwrite(&numocc, sizeof(numocc), 1, stdout); - fwrite(&len, sizeof(len), 1, stdout); - - for (i = 0; i < numocc; i++){ - fwrite(snippet_text+len*i,sizeof(uchar),snippet_len[i],stdout); - for(j=snippet_len[i];j Date: Thu, 12 Sep 2013 10:12:48 +1000 Subject: [PATCH 3/7] Don't be in hugepage more, when allocation failed. --- include/sdsl/memory_management.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sdsl/memory_management.hpp b/include/sdsl/memory_management.hpp index 7eb48acf5..4b9f0df5e 100644 --- a/include/sdsl/memory_management.hpp +++ b/include/sdsl/memory_management.hpp @@ -201,8 +201,8 @@ class memory_manager public: static void use_hugepages(size_t bytes) { auto& m = the_manager(); - m.hugepages = true; hugepage_allocator::the_allocator().init(bytes); + m.hugepages = true; } template static void resize(t_vec& v, const typename t_vec::size_type size) { From 885612fa597648cf338d4e1fa6077a8979524f9e Mon Sep 17 00:00:00 2001 From: Simon Gog Date: Thu, 12 Sep 2013 10:13:27 +1000 Subject: [PATCH 4/7] Fixed calculation of allocation size. --- benchmark/indexing_count/src/run_queries_sdsl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/benchmark/indexing_count/src/run_queries_sdsl.cpp b/benchmark/indexing_count/src/run_queries_sdsl.cpp index 94999b40a..a2206ea32 100644 --- a/benchmark/indexing_count/src/run_queries_sdsl.cpp +++ b/benchmark/indexing_count/src/run_queries_sdsl.cpp @@ -54,12 +54,12 @@ int main(int argc, char* argv[]) #ifdef USE_HP uint64_t index_size = util::file_size(index_file); // allocate hugepages, add 10 MiB + 3% overhead - uint64_t alloc_size = (uint64_t)(index_size*0.03+(1ULL<<20)*10); + uint64_t alloc_size = (uint64_t)(index_size*1.03+(1ULL<<20)*10); try { memory_manager::use_hugepages(alloc_size); mapped = true; } catch (...) { - std::cout<<"Unable to allocate "< Date: Thu, 12 Sep 2013 13:44:18 +1000 Subject: [PATCH 5/7] debugging the memory bug --- CMakeLists.txt | 2 +- benchmark/indexing_count/Makefile | 4 +-- .../indexing_count/compile_options.config | 12 ++++----- include/sdsl/int_vector.hpp | 19 +++++++------ include/sdsl/memory_management.hpp | 27 +++++++++++++------ include/sdsl/rrr_vector.hpp | 1 + include/sdsl/rrr_vector_15.hpp | 2 ++ 7 files changed, 42 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a4705277f..1dccdc5d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,7 @@ set(LIBRARY_VERSION "${LIBRARY_VERSION_MAJOR}.${LIBRARY_VERSION_MINOR}") set(LIBRARY_VERSION_FULL "${LIBRARY_VERSION}.${LIBRARY_VERSION_PATCH}") append_cxx_compiler_flags("-std=c++11 -Wall -DNDEBUG" "GCC" CMAKE_CXX_FLAGS) -append_cxx_compiler_flags("-O9 -ffast-math -funroll-loops" "GCC" CMAKE_CXX_OPT_FLAGS) +append_cxx_compiler_flags("-O0 -g -ffast-math -funroll-loops" "GCC" CMAKE_CXX_OPT_FLAGS) append_cxx_compiler_flags("-std=c++11 -funroll-loops -DNDEBUG -stdlib=libc++" "CLANG" CMAKE_CXX_FLAGS) append_cxx_compiler_flags("-O3 -ffast-math -funroll-loops" "CLANG" CMAKE_CXX_OPT_FLAGS) diff --git a/benchmark/indexing_count/Makefile b/benchmark/indexing_count/Makefile index 6893e18de..2be3e20fb 100644 --- a/benchmark/indexing_count/Makefile +++ b/benchmark/indexing_count/Makefile @@ -55,7 +55,7 @@ results/%: $(BUILD_EXECS) $(QUERY_EXECS) $(PATTERNS) $(INDEXES) @echo "# COMPILE_ID = $(COMPILE_ID)" >> $@ @echo "# test_case = $(TC_NAME)" >> $@ @echo "Run timing for $(IDX_ID).$(COMPILE_ID) on $(TC_ID)" - @$(BIN_DIR)/query_idx_$(IDX_ID).$(COMPILE_ID) \ + $(BIN_DIR)/query_idx_$(IDX_ID).$(COMPILE_ID) \ indexes/$(TC_ID) C < $(PAT_DIR)/$(TC_ID).pattern 2>> $@ @@ -65,7 +65,7 @@ indexes/%: $(BUILD_EXECS) $(eval IDX_ID:=$(call dim,2,$*)) $(eval TC:=$(call config_select,test_case.config,$(TC_ID),2)) @echo "Building index $(IDX_ID) on $(TC)" - @$(BIN_DIR)/build_idx_$(IDX_ID) $(TC) $(TMP_DIR) $@ + $(BIN_DIR)/build_idx_$(IDX_ID) $(TC) $(TMP_DIR) $@ # info/[TC_ID].[IDX_ID] info/%.json: $(INDEXES) diff --git a/benchmark/indexing_count/compile_options.config b/benchmark/indexing_count/compile_options.config index 6c7e8899f..660d5c39a 100644 --- a/benchmark/indexing_count/compile_options.config +++ b/benchmark/indexing_count/compile_options.config @@ -2,9 +2,9 @@ # Column description (columns are separated by semicolon): # (1) Identifier for compile configuration (consisting of letters) # (2) Compile options -NOOPT;-std=c++11 -DPOPCOUNT_TL -O3 -funroll-loops -fomit-frame-pointer -ffast-math -DNDEBUG -NOSSE;-std=c++11 -O3 -funroll-loops -fomit-frame-pointer -ffast-math -DNDEBUG -SSE;-std=c++11 -msse4.2 -O3 -funroll-loops -fomit-frame-pointer -ffast-math -DNDEBUG -HP;-std=c++11 -DUSE_HP -msse4.2 -O3 -funroll-loops -fomit-frame-pointer -ffast-math -DNDEBUG -O1;-std=c++11 -O1 -DNDEBUG -O0;-std=c++11 -O0 -DNDEBUG +NOOPT;-std=c++11 -DPOPCOUNT_TL -O0 -g -funroll-loops -fomit-frame-pointer -ffast-math +NOSSE;-std=c++11 -O0 -g -funroll-loops -fomit-frame-pointer -ffast-math +SSE;-std=c++11 -msse4.2 -O0 -g -funroll-loops -fomit-frame-pointer -ffast-math +HP;-std=c++11 -DUSE_HP -msse4.2 -O0 -g -funroll-loops -fomit-frame-pointer -ffast-math +O1;-std=c++11 -O1 +O0;-std=c++11 -O0 diff --git a/include/sdsl/int_vector.hpp b/include/sdsl/int_vector.hpp index 56a1234e8..502f3ad26 100644 --- a/include/sdsl/int_vector.hpp +++ b/include/sdsl/int_vector.hpp @@ -1085,7 +1085,7 @@ template inline typename std::enable_if::value, std::ostream&>::type operator<<(std::ostream& os, const t_bv& bv) { - for (auto b : bv) { +for (auto b : bv) { os << b; } return os; @@ -1191,14 +1191,14 @@ template auto int_vector::get_int(size_type idx, const uint8_t len)const -> const value_type { #ifdef SDSL_DEBUG - if (idx+len > m_size) { - throw std::out_of_range("OUT_OF_RANGE_ERROR: int_vector::get_int(size_type, uint8_t); idx+len > size()!"); - } - if (len > 64) { - throw std::out_of_range("OUT_OF_RANGE_ERROR: int_vector::get_int(size_type, uint8_t); len>64!"); - } +if (idx+len > m_size) { +throw std::out_of_range("OUT_OF_RANGE_ERROR: int_vector::get_int(size_type, uint8_t); idx+len > size()!"); +} +if (len > 64) { +throw std::out_of_range("OUT_OF_RANGE_ERROR: int_vector::get_int(size_type, uint8_t); len>64!"); +} #endif - return bits::read_int(m_data+(idx>>6), idx&0x3F, len); +return bits::read_int(m_data+(idx>>6), idx&0x3F, len); } template @@ -1385,6 +1385,7 @@ typename int_vector::size_type int_vector::serialize(std::ostr } else { written_bytes += int_vector::write_header(m_size, m_width, out); } + std::cout << "write size = " << m_size << std::endl; uint64_t* p = m_data; size_type idx = 0; @@ -1406,6 +1407,8 @@ void int_vector::load(std::istream& in) size_type size; int_vector::read_header(size, m_width, in); + std::cout << "read size = " << size << std::endl; + bit_resize(size); uint64_t* p = m_data; size_type idx = 0; diff --git a/include/sdsl/memory_management.hpp b/include/sdsl/memory_management.hpp index 4b9f0df5e..fc3d3a529 100644 --- a/include/sdsl/memory_management.hpp +++ b/include/sdsl/memory_management.hpp @@ -158,6 +158,15 @@ class hugepage_allocator void* mm_realloc(void* ptr, size_t size); void* mm_alloc(size_t size_in_bytes); void mm_free(void* ptr); + bool in_address_space(void* ptr) { + // check if ptr is in the hugepage address space + std::ptrdiff_t before_start = (uint8_t*)ptr - m_base; + std::ptrdiff_t after_top = (uint8_t*)m_top - (uint8_t*)ptr; + if (before_start>=0 and after_top>=0) { + return true; + } + return false; + } static hugepage_allocator& the_allocator() { static hugepage_allocator a; return a; @@ -184,7 +193,7 @@ class memory_manager } static void free_mem(uint64_t* ptr) { auto& m = the_manager(); - if (m.hugepages) { + if (m.hugepages and hugepage_allocator::the_allocator().in_address_space(ptr)) { hugepage_allocator::the_allocator().mm_free(ptr); } else { std::free(ptr); @@ -206,20 +215,22 @@ class memory_manager } template static void resize(t_vec& v, const typename t_vec::size_type size) { - int64_t old_size_in_bytes = ((v.m_size+63)>>6)<<3; - int64_t new_size_in_bytes = ((size+63)>>6)<<3; + std::cout << "size = " << size << std::endl; + uint64_t old_size_in_bytes = ((v.m_size+63)>>6)<<3; + uint64_t new_size_in_bytes = ((size+63)>>6)<<3; bool do_realloc = old_size_in_bytes != new_size_in_bytes; v.m_size = size; - if (do_realloc || new_size_in_bytes == 0) { + if (do_realloc || v.m_data == nullptr) { // Note that we allocate 8 additional bytes if m_size % 64 == 0. // We need this padding since rank data structures do a memory // access to this padding to answer rank(size()) if size()%64 ==0. // Note that this padding is not counted in the serialize method! size_t allocated_bytes = (((size+64)>>6)<<3); + std::cout << "allocated_bytes = " << allocated_bytes << " ptr = " << (void*)v.m_data << std::endl; v.m_data = memory_manager::realloc_mem(v.m_data,allocated_bytes); - if (allocated_bytes != 0 && v.m_data == nullptr) { - throw std::bad_alloc(); - } + //if (allocated_bytes != 0 && v.m_data == nullptr) { + // throw std::bad_alloc(); + //} // update and fill with 0s if (v.bit_size() < v.capacity()) { bits::write_int(v.m_data+(v.bit_size()>>6), 0, v.bit_size()&0x3F, v.capacity() - v.bit_size()); @@ -230,7 +241,7 @@ class memory_manager // update stats if (do_realloc) { - memory_monitor::record(new_size_in_bytes-old_size_in_bytes); + memory_monitor::record((int64_t)new_size_in_bytes-(int64_t)old_size_in_bytes); } } } diff --git a/include/sdsl/rrr_vector.hpp b/include/sdsl/rrr_vector.hpp index ea0bb97a8..cc02c8741 100644 --- a/include/sdsl/rrr_vector.hpp +++ b/include/sdsl/rrr_vector.hpp @@ -305,6 +305,7 @@ class rrr_vector //! Loads the data structure from the given istream. void load(std::istream& in) { read_member(m_size, in); + std::cout << "m_size = " << m_size << std::endl; m_bt.load(in); m_btnr.load(in); m_btnrp.load(in); diff --git a/include/sdsl/rrr_vector_15.hpp b/include/sdsl/rrr_vector_15.hpp index a8e3bb421..fb56892a7 100644 --- a/include/sdsl/rrr_vector_15.hpp +++ b/include/sdsl/rrr_vector_15.hpp @@ -317,6 +317,7 @@ class rrr_vector<15, t_rac, t_k> size_type written_bytes = 0; structure_tree_node* child = structure_tree::add_child(v, name, util::class_name(*this)); written_bytes += write_member(m_size, out, child, "size"); + std::cout << "rrr<15> size = " << m_size << std::endl; written_bytes += m_bt.serialize(out, child, "bt"); written_bytes += m_btnr.serialize(out, child, "btnr"); written_bytes += m_btnrp.serialize(out, child, "btnrp"); @@ -328,6 +329,7 @@ class rrr_vector<15, t_rac, t_k> //! Loads the data structure from the given istream. void load(std::istream& in) { read_member(m_size, in); + std::cout << "rrr<15> size = " << m_size << std::endl; m_bt.load(in); m_btnr.load(in); m_btnrp.load(in); From 89dc9b145bf689b702ef75cce7da3bbbf42f9e7b Mon Sep 17 00:00:00 2001 From: Simon Gog Date: Thu, 12 Sep 2013 14:09:08 +1000 Subject: [PATCH 6/7] Fixed move operator. --- include/sdsl/rrr_vector.hpp | 1 + include/sdsl/rrr_vector_15.hpp | 1 + 2 files changed, 2 insertions(+) diff --git a/include/sdsl/rrr_vector.hpp b/include/sdsl/rrr_vector.hpp index cc02c8741..c5e4da212 100644 --- a/include/sdsl/rrr_vector.hpp +++ b/include/sdsl/rrr_vector.hpp @@ -130,6 +130,7 @@ class rrr_vector //! Move constructor rrr_vector(rrr_vector&& rrr) : m_size(std::move(rrr.m_size)), + m_bt(std::move(rrr.m_bt)), m_btnr(std::move(rrr.m_btnr)), m_btnrp(std::move(rrr.m_btnrp)), m_rank(std::move(rrr.m_rank)), m_invert(std::move(rrr.m_invert)) {} diff --git a/include/sdsl/rrr_vector_15.hpp b/include/sdsl/rrr_vector_15.hpp index fb56892a7..a67f31df3 100644 --- a/include/sdsl/rrr_vector_15.hpp +++ b/include/sdsl/rrr_vector_15.hpp @@ -174,6 +174,7 @@ class rrr_vector<15, t_rac, t_k> //! Move constructor rrr_vector(rrr_vector&& rrr) : m_size(std::move(rrr.m_size)), + m_bt(std::move(rrr.m_bt)), m_btnr(std::move(rrr.m_btnr)), m_btnrp(std::move(rrr.m_btnrp)), m_rank(std::move(rrr.m_rank)) {} From e2a7467d456e96c59b3d7fba52b1b113980b84f4 Mon Sep 17 00:00:00 2001 From: Matthias Petri Date: Thu, 12 Sep 2013 14:59:48 +1000 Subject: [PATCH 7/7] fixed memory management and removed debug output --- include/sdsl/int_vector.hpp | 21 +++++++++------------ include/sdsl/memory_management.hpp | 18 ++++++++---------- include/sdsl/rrr_vector.hpp | 1 - include/sdsl/rrr_vector_15.hpp | 2 -- 4 files changed, 17 insertions(+), 25 deletions(-) diff --git a/include/sdsl/int_vector.hpp b/include/sdsl/int_vector.hpp index 502f3ad26..289858c04 100644 --- a/include/sdsl/int_vector.hpp +++ b/include/sdsl/int_vector.hpp @@ -304,7 +304,7 @@ class int_vector int_vector(std::initializer_list il) : int_vector() { resize(il.size()); size_type idx = 0; -for (auto x : il) { + for (auto x : il) { (*this)[idx++] = x; } } @@ -1085,7 +1085,7 @@ template inline typename std::enable_if::value, std::ostream&>::type operator<<(std::ostream& os, const t_bv& bv) { -for (auto b : bv) { + for (auto b : bv) { os << b; } return os; @@ -1191,14 +1191,14 @@ template auto int_vector::get_int(size_type idx, const uint8_t len)const -> const value_type { #ifdef SDSL_DEBUG -if (idx+len > m_size) { -throw std::out_of_range("OUT_OF_RANGE_ERROR: int_vector::get_int(size_type, uint8_t); idx+len > size()!"); -} -if (len > 64) { -throw std::out_of_range("OUT_OF_RANGE_ERROR: int_vector::get_int(size_type, uint8_t); len>64!"); -} + if (idx+len > m_size) { + throw std::out_of_range("OUT_OF_RANGE_ERROR: int_vector::get_int(size_type, uint8_t); idx+len > size()!"); + } + if (len > 64) { + throw std::out_of_range("OUT_OF_RANGE_ERROR: int_vector::get_int(size_type, uint8_t); len>64!"); + } #endif -return bits::read_int(m_data+(idx>>6), idx&0x3F, len); + return bits::read_int(m_data+(idx>>6), idx&0x3F, len); } template @@ -1385,7 +1385,6 @@ typename int_vector::size_type int_vector::serialize(std::ostr } else { written_bytes += int_vector::write_header(m_size, m_width, out); } - std::cout << "write size = " << m_size << std::endl; uint64_t* p = m_data; size_type idx = 0; @@ -1407,8 +1406,6 @@ void int_vector::load(std::istream& in) size_type size; int_vector::read_header(size, m_width, in); - std::cout << "read size = " << size << std::endl; - bit_resize(size); uint64_t* p = m_data; size_type idx = 0; diff --git a/include/sdsl/memory_management.hpp b/include/sdsl/memory_management.hpp index fc3d3a529..a07bf7cd6 100644 --- a/include/sdsl/memory_management.hpp +++ b/include/sdsl/memory_management.hpp @@ -160,9 +160,10 @@ class hugepage_allocator void mm_free(void* ptr); bool in_address_space(void* ptr) { // check if ptr is in the hugepage address space - std::ptrdiff_t before_start = (uint8_t*)ptr - m_base; - std::ptrdiff_t after_top = (uint8_t*)m_top - (uint8_t*)ptr; - if (before_start>=0 and after_top>=0) { + if (ptr == nullptr) { + return true; + } + if (ptr >= m_base && ptr < m_top) { return true; } return false; @@ -201,7 +202,7 @@ class memory_manager } static uint64_t* realloc_mem(uint64_t* ptr,size_t size) { auto& m = the_manager(); - if (m.hugepages) { + if (m.hugepages and hugepage_allocator::the_allocator().in_address_space(ptr)) { return (uint64_t*) hugepage_allocator::the_allocator().mm_realloc(ptr,size); } else { return (uint64_t*) realloc(ptr,size); @@ -215,7 +216,6 @@ class memory_manager } template static void resize(t_vec& v, const typename t_vec::size_type size) { - std::cout << "size = " << size << std::endl; uint64_t old_size_in_bytes = ((v.m_size+63)>>6)<<3; uint64_t new_size_in_bytes = ((size+63)>>6)<<3; bool do_realloc = old_size_in_bytes != new_size_in_bytes; @@ -226,11 +226,10 @@ class memory_manager // access to this padding to answer rank(size()) if size()%64 ==0. // Note that this padding is not counted in the serialize method! size_t allocated_bytes = (((size+64)>>6)<<3); - std::cout << "allocated_bytes = " << allocated_bytes << " ptr = " << (void*)v.m_data << std::endl; v.m_data = memory_manager::realloc_mem(v.m_data,allocated_bytes); - //if (allocated_bytes != 0 && v.m_data == nullptr) { - // throw std::bad_alloc(); - //} + if (allocated_bytes != 0 && v.m_data == nullptr) { + throw std::bad_alloc(); + } // update and fill with 0s if (v.bit_size() < v.capacity()) { bits::write_int(v.m_data+(v.bit_size()>>6), 0, v.bit_size()&0x3F, v.capacity() - v.bit_size()); @@ -259,7 +258,6 @@ class memory_manager } }; - } // end namespace #endif diff --git a/include/sdsl/rrr_vector.hpp b/include/sdsl/rrr_vector.hpp index cc02c8741..ea0bb97a8 100644 --- a/include/sdsl/rrr_vector.hpp +++ b/include/sdsl/rrr_vector.hpp @@ -305,7 +305,6 @@ class rrr_vector //! Loads the data structure from the given istream. void load(std::istream& in) { read_member(m_size, in); - std::cout << "m_size = " << m_size << std::endl; m_bt.load(in); m_btnr.load(in); m_btnrp.load(in); diff --git a/include/sdsl/rrr_vector_15.hpp b/include/sdsl/rrr_vector_15.hpp index fb56892a7..a8e3bb421 100644 --- a/include/sdsl/rrr_vector_15.hpp +++ b/include/sdsl/rrr_vector_15.hpp @@ -317,7 +317,6 @@ class rrr_vector<15, t_rac, t_k> size_type written_bytes = 0; structure_tree_node* child = structure_tree::add_child(v, name, util::class_name(*this)); written_bytes += write_member(m_size, out, child, "size"); - std::cout << "rrr<15> size = " << m_size << std::endl; written_bytes += m_bt.serialize(out, child, "bt"); written_bytes += m_btnr.serialize(out, child, "btnr"); written_bytes += m_btnrp.serialize(out, child, "btnrp"); @@ -329,7 +328,6 @@ class rrr_vector<15, t_rac, t_k> //! Loads the data structure from the given istream. void load(std::istream& in) { read_member(m_size, in); - std::cout << "rrr<15> size = " << m_size << std::endl; m_bt.load(in); m_btnr.load(in); m_btnrp.load(in);