Add debug string and ODesc support to HashKey class

This allows tracing of hash key buffer reservations, reads, and writes via a new
debug stream, and supports printing a summary of a HashKey object via
Describe(). The latter comes in handy e.g. in TableVal::Describe() (where
including the hash key is now available but commented out).
This commit is contained in:
Christian Kreibich 2021-09-16 17:18:09 -07:00
parent 82822b1e07
commit b6a11a69db
5 changed files with 76 additions and 1 deletions

View file

@ -28,8 +28,12 @@
namespace zeek
{
class String;
class ODesc;
}
namespace zeek::detail
{
@ -354,6 +358,8 @@ public:
const void* KeyAtRead() const { return static_cast<void*>(key + read_size); }
const void* KeyEnd() const { return static_cast<void*>(key + size); }
void Describe(ODesc* d) const;
protected:
char* CopyKey(const char* key, size_t size) const;