From acede9d68299aeda6efc969b6abeea99567c639e Mon Sep 17 00:00:00 2001 From: Jan Wassenberg Date: Tue, 21 Oct 2025 10:17:06 -0700 Subject: [PATCH] Warning fix (unused var), Windows build fix (missing member variable) PiperOrigin-RevId: 822172982 --- compression/int-inl.h | 2 -- util/allocator.cc | 4 ++-- util/allocator.h | 1 + 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/compression/int-inl.h b/compression/int-inl.h index 969ec6dc..81f1cafe 100644 --- a/compression/int-inl.h +++ b/compression/int-inl.h @@ -159,7 +159,6 @@ class IntCodec { const hn::Rebind di32; const hn::Rebind di16; const hn::Rebind di8; - const hn::Rebind df8; const size_t N = hn::Lanes(di8); const size_t N32 = hn::Lanes(df); @@ -387,7 +386,6 @@ class IntCodec { const hn::Rebind di32; const hn::Rebind di16; const hn::Rebind di8; - const hn::Rebind df8; const size_t N = hn::Lanes(di8); using VI8 = hn::Vec; diff --git a/util/allocator.cc b/util/allocator.cc index 612bbb94..41084490 100644 --- a/util/allocator.cc +++ b/util/allocator.cc @@ -156,6 +156,7 @@ CacheInfo::CacheInfo(const BoundedTopology& topology) { Allocator::Allocator(const BoundedTopology& topology, const CacheInfo& cache_info, bool enable_bind) : line_bytes_(cache_info.LineBytes()), + step_bytes_(cache_info.StepBytes()), base_page_bytes_(DetectPageSize()), total_mib_(DetectTotalMiB(base_page_bytes_)) { quantum_bytes_ = cache_info.StepBytes(); // may overwrite below @@ -239,9 +240,8 @@ AlignedPtr Allocator::AllocBytes(size_t bytes) const { static_cast(p), DeleterFunc([bytes](void* ptr) { HWY_ASSERT(munmap(ptr, bytes) == 0); })); #elif HWY_OS_WIN - const size_t alignment = HWY_MAX(vector_bytes_, line_bytes_); return AlignedPtr( - static_cast(_aligned_malloc(bytes, alignment)), + static_cast(_aligned_malloc(bytes, step_bytes_)), DeleterFunc([](void* ptr) { _aligned_free(ptr); })); #else return AlignedPtr(nullptr, DeleterFunc()); diff --git a/util/allocator.h b/util/allocator.h index d508d5cc..9b9267a2 100644 --- a/util/allocator.h +++ b/util/allocator.h @@ -176,6 +176,7 @@ class Allocator { private: const size_t line_bytes_; + const size_t step_bytes_; const size_t base_page_bytes_; const size_t total_mib_;