Skip to content

Commit 10e6be8

Browse files
committed
Adding clear method.
1 parent 85ae2a4 commit 10e6be8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/mips/common/util/bitfield.hh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,11 @@ struct BitField {
167167
set<offset, Field::Width,
168168
BitFieldInternal::SignedStorageType<(offset % 8) + Field::Width, typename Field::Underlying>>(v);
169169
}
170+
void clear() {
171+
for (unsigned i = 0; i < sizeof(storage); i++) {
172+
storage[i] = 0;
173+
}
174+
}
170175

171176
private:
172177
template <unsigned offset, unsigned width, std::integral U>

0 commit comments

Comments
 (0)