Avoid warning about inability to map, unless explicitly requested

PiperOrigin-RevId: 767633815
This commit is contained in:
Jan Wassenberg 2025-06-05 09:09:26 -07:00 committed by Copybara-Service
parent 3a266c662c
commit 0e2cab5187
1 changed files with 2 additions and 2 deletions

View File

@ -267,12 +267,12 @@ static Mode ChooseMode(uint64_t file_bytes, const LoaderArgs& loader,
// Disable mapping if not padded to the base page size.
const Allocator& allocator = ThreadingContext::Get().allocator;
if (file_bytes % allocator.BasePageBytes() != 0) {
if (map != Tristate::kFalse) { // Do not complain if anyway disabled.
if (map == Tristate::kTrue) { // Only complain if explicitly requested.
HWY_WARN("Unable to map non-padded file (%zu, %zu), reading instead.",
static_cast<size_t>(file_bytes >> 10),
allocator.BasePageBytes());
map = Tristate::kFalse;
}
map = Tristate::kFalse;
}
// Check for user override: