Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion snappy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -703,8 +703,17 @@ WorkingMemory::~WorkingMemory() {
uint16_t* WorkingMemory::GetHashTable(size_t fragment_size,
int* table_size) const {
const size_t htsize = CalculateTableSize(fragment_size);
memset(table_, 0, htsize * sizeof(*table_));
*table_size = htsize;
#if SNAPPY_HAVE_VECTOR_BYTE_SHUFFLE
assert(table_size % 16 == 0);
table_[0] = 0;
V128 pattern = V128_DupChar(table_[0]);
for(uint64_t i = 0; i < htsize * sizeof(*table_) / 16; i++ ) {
V128_StoreU(reinterpret_cast<V128*>(reinterpret_cast<char*>(table_) + 16 * i), pattern);
}
#else
memset(table_, 0, htsize * sizeof(*table_));
#endif
return table_;
}
} // end namespace internal
Expand Down