8337995: ZUtils::fill uses std::fill_n

Reviewed-by: mli, stefank, jwaters, tschatzl
This commit is contained in:
Kim Barrett 2024-12-12 14:40:04 +00:00
parent f71d515026
commit 22845a77a2

View File

@ -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 <algorithm>
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;
}
}