Skip to content

Commit 78cf14d

Browse files
committed
small bug in reallocate
1 parent eba3f22 commit 78cf14d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/sketch_columns.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ void ResizeableSketchColumn::reallocate(uint8_t new_capacity) {
9191
auto new_buckets = hwy::AllocateAligned<Bucket>(new_capacity);
9292
std::memset(new_buckets.get() + capacity, 0,
9393
(resize_capacity - capacity) * sizeof(Bucket));
94+
// old capacity:
9495
std::memcpy(new_buckets.get(), aligned_buckets.get(),
95-
resize_capacity * sizeof(Bucket));
96+
capacity * sizeof(Bucket));
9697
aligned_buckets = std::move(new_buckets);
9798
capacity = new_capacity;
9899
}

0 commit comments

Comments
 (0)