From 22845a77a2175202876d0029f75fa32271e07b91 Mon Sep 17 00:00:00 2001 From: Kim Barrett Date: Thu, 12 Dec 2024 14:40:04 +0000 Subject: [PATCH] 8337995: ZUtils::fill uses std::fill_n Reviewed-by: mli, stefank, jwaters, tschatzl --- src/hotspot/share/gc/z/zUtils.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hotspot/share/gc/z/zUtils.cpp b/src/hotspot/share/gc/z/zUtils.cpp index 3804baad595..7997242f391 100644 --- a/src/hotspot/share/gc/z/zUtils.cpp +++ b/src/hotspot/share/gc/z/zUtils.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,8 +25,6 @@ #include "gc/z/zUtils.hpp" #include "runtime/nonJavaThread.hpp" -#include - const char* ZUtils::thread_name() { const Thread* const thread = Thread::current(); if (thread->is_Named_thread()) { @@ -38,5 +36,7 @@ const char* ZUtils::thread_name() { } void ZUtils::fill(uintptr_t* addr, size_t count, uintptr_t value) { - std::fill_n(addr, count, value); + for (size_t i = 0; i < count; ++i) { + addr[i] = value; + } }