@@ -14,10 +14,14 @@ class template_repo_base {
1414 template_repo_base (mfast::allocator *dictionary_alloc)
1515 : dictionary_alloc_(dictionary_alloc) {}
1616 virtual ~template_repo_base () {
17- for (auto &elem : vector_enties_ ) {
17+ for (auto &elem : vector_entries_ ) {
1818 if (elem->of_array .capacity_in_bytes_ )
19+ {
1920 dictionary_alloc_->deallocate (elem->of_array .content_ ,
2021 elem->of_array .capacity_in_bytes_ );
22+ elem->of_array .capacity_in_bytes_ = 0 ;
23+ elem->of_array .content_ = nullptr ;
24+ }
2125 }
2226 }
2327
@@ -33,17 +37,20 @@ class template_repo_base {
3337 void add_reset_entry (value_storage *entry) {
3438 reset_entries_.push_back (entry);
3539 }
40+ #ifdef TESTING_TEMPLATE_REPO_BASE
41+ public:
42+ #endif
3643 void add_vector_entry (value_storage *entry) {
3744 if (dictionary_alloc_)
38- vector_enties_ .push_back (entry);
45+ vector_entries_ .push_back (entry);
3946 }
4047
4148protected:
4249 friend class dictionary_builder ;
4350
4451 typedef std::vector<value_storage *> value_entries_t ;
4552 value_entries_t reset_entries_;
46- value_entries_t vector_enties_ ; // for string and byteVector
53+ value_entries_t vector_entries_ ; // for string and byteVector
4754 arena_allocator instruction_alloc_;
4855 mfast::allocator *dictionary_alloc_;
4956};
0 commit comments