Skip to content

Commit acede9d

Browse files
jan-wassenbergcopybara-github
authored andcommitted
Warning fix (unused var), Windows build fix (missing member variable)
PiperOrigin-RevId: 822172982
1 parent f59eb2e commit acede9d

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

compression/int-inl.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ class IntCodec {
159159
const hn::Rebind<int32_t, decltype(df)> di32;
160160
const hn::Rebind<int16_t, decltype(di32)> di16;
161161
const hn::Rebind<int8_t, decltype(di16)> di8;
162-
const hn::Rebind<int8_t, decltype(df)> df8;
163162

164163
const size_t N = hn::Lanes(di8);
165164
const size_t N32 = hn::Lanes(df);
@@ -387,7 +386,6 @@ class IntCodec {
387386
const hn::Rebind<int32_t, decltype(df)> di32;
388387
const hn::Rebind<int16_t, decltype(di32)> di16;
389388
const hn::Rebind<int8_t, decltype(di16)> di8;
390-
const hn::Rebind<int8_t, decltype(df)> df8;
391389

392390
const size_t N = hn::Lanes(di8);
393391
using VI8 = hn::Vec<decltype(di8)>;

util/allocator.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ CacheInfo::CacheInfo(const BoundedTopology& topology) {
156156
Allocator::Allocator(const BoundedTopology& topology,
157157
const CacheInfo& cache_info, bool enable_bind)
158158
: line_bytes_(cache_info.LineBytes()),
159+
step_bytes_(cache_info.StepBytes()),
159160
base_page_bytes_(DetectPageSize()),
160161
total_mib_(DetectTotalMiB(base_page_bytes_)) {
161162
quantum_bytes_ = cache_info.StepBytes(); // may overwrite below
@@ -239,9 +240,8 @@ AlignedPtr<uint8_t[]> Allocator::AllocBytes(size_t bytes) const {
239240
static_cast<uint8_t*>(p),
240241
DeleterFunc([bytes](void* ptr) { HWY_ASSERT(munmap(ptr, bytes) == 0); }));
241242
#elif HWY_OS_WIN
242-
const size_t alignment = HWY_MAX(vector_bytes_, line_bytes_);
243243
return AlignedPtr<uint8_t[]>(
244-
static_cast<uint8_t*>(_aligned_malloc(bytes, alignment)),
244+
static_cast<uint8_t*>(_aligned_malloc(bytes, step_bytes_)),
245245
DeleterFunc([](void* ptr) { _aligned_free(ptr); }));
246246
#else
247247
return AlignedPtr<uint8_t[]>(nullptr, DeleterFunc());

util/allocator.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ class Allocator {
176176

177177
private:
178178
const size_t line_bytes_;
179+
const size_t step_bytes_;
179180
const size_t base_page_bytes_;
180181
const size_t total_mib_;
181182

0 commit comments

Comments
 (0)