refine Val "footprint" to equate long strings with multiple objects

This commit is contained in:
Vern Paxson 2024-04-29 12:39:36 -07:00
parent d7e30d9ee2
commit 1f9fa4304d
6 changed files with 20 additions and 1 deletions

View file

@ -12,6 +12,7 @@ l1, 3
l1b, 6
l2, 7
l2b, 9
l2c, T
v1, 8
v2, 18
v3, 11

View file

@ -54,6 +54,12 @@ event zeek_init()
local l2b = r2($a=3, $b1=99.0, $c="I'm here");
print "l2b", val_footprint(l2b);
local l2c = r2($a=3, $b1=99e99, $c="I'm here and really very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very very long-winded");
# In the following, we just print the comparison rather than the
# actual footprint value, since the latter will change depending
# on the size of C++ pointers and the like.
print "l2c", val_footprint(l2c) > val_footprint(l2b);
local v1 = vector(9, 7, 3, 1);
print "v1", val_footprint(v1);