Remove deprecated MemoryAllocation() methods and related code

This commit is contained in:
Tim Wojtulewicz 2022-06-15 14:54:47 -07:00
parent d3169e48c0
commit 70e63d4749
39 changed files with 15 additions and 659 deletions

View file

@ -411,47 +411,6 @@ int Specific_RE_Matcher::LongestMatch(const u_char* bv, int n)
return last_accept;
}
unsigned int Specific_RE_Matcher::MemoryAllocation() const
{
unsigned int size = 0;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
for ( int i = 0; i < ccl_list.length(); ++i )
size += ccl_list[i]->MemoryAllocation();
#pragma GCC diagnostic pop
size += util::pad_size(sizeof(CCL*) * ccl_dict.size());
for ( const auto& entry : ccl_dict )
{
size += padded_sizeof(std::string) +
util::pad_size(sizeof(std::string::value_type) * entry.first.size());
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
size += entry.second->MemoryAllocation();
#pragma GCC diagnostic pop
}
for ( const auto& entry : defs )
{
size += padded_sizeof(std::string) +
util::pad_size(sizeof(std::string::value_type) * entry.first.size());
size += padded_sizeof(std::string) +
util::pad_size(sizeof(std::string::value_type) * entry.second.size());
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
return size + padded_sizeof(*this) +
(pattern_text ? util::pad_size(strlen(pattern_text) + 1) : 0) +
ccl_list.MemoryAllocation() - padded_sizeof(ccl_list) + equiv_class.Size() -
padded_sizeof(EquivClass) +
(dfa ? dfa->MemoryAllocation() : 0) // this is ref counted; consider the bytes here?
+ padded_sizeof(*any_ccl) + padded_sizeof(*accepted) // NOLINT(bugprone-sizeof-container)
+ accepted->size() * padded_sizeof(AcceptingSet::key_type);
#pragma GCC diagnostic pop
}
static RE_Matcher* matcher_merge(const RE_Matcher* re1, const RE_Matcher* re2, const char* merge_op)
{
const char* text1 = re1->PatternText();