From 328edcfc64c05590c947225824c97e8b3e8f438b Mon Sep 17 00:00:00 2001 From: Michael Richters Date: Tue, 6 Apr 2021 18:45:11 -0500 Subject: [PATCH] Add `KeyAddrBitField::clear()` method Signed-off-by: Michael Richters --- src/kaleidoscope/KeyAddrBitfield.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/kaleidoscope/KeyAddrBitfield.h b/src/kaleidoscope/KeyAddrBitfield.h index cf4cc66c..bd764ca3 100644 --- a/src/kaleidoscope/KeyAddrBitfield.h +++ b/src/kaleidoscope/KeyAddrBitfield.h @@ -70,6 +70,9 @@ class KeyAddrBitfield { // assert(k.toInt() < size); bitWrite(data_[blockIndex(k)], bitIndex(k), value); } + void clear() { + memset(data_, 0, sizeof(data_)); + } // This function returns the number of set bits in the bitfield up to and // including the bit at index `k`. Two important things to note: it doesn't