mirror of
https://github.com/zeek/zeek.git
synced 2025-10-06 16:48:19 +00:00
refine Val "footprint" to equate long strings with multiple objects
This commit is contained in:
parent
d7e30d9ee2
commit
1f9fa4304d
6 changed files with 20 additions and 1 deletions
|
@ -855,6 +855,10 @@ StringValPtr StringVal::Replace(RE_Matcher* re, const String& repl, bool do_all)
|
|||
return make_intrusive<StringVal>(new String(true, result, r - result));
|
||||
}
|
||||
|
||||
unsigned int StringVal::ComputeFootprint(std::unordered_set<const Val*>* analyzed_vals) const {
|
||||
return 1 /* this object */ + static_cast<unsigned int>(Len()) / sizeof(Val);
|
||||
}
|
||||
|
||||
static std::variant<ValPtr, std::string> BuildVal(const rapidjson::Value& j, const TypePtr& t,
|
||||
const FuncPtr& key_func) {
|
||||
auto mismatch_err = [t, &j]() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue