diff --git a/src/hotspot/share/nmt/mallocHeader.cpp b/src/hotspot/share/nmt/mallocHeader.cpp index a125ba416b1..d5a7b689c2a 100644 --- a/src/hotspot/share/nmt/mallocHeader.cpp +++ b/src/hotspot/share/nmt/mallocHeader.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2024, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2021, 2022 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -64,7 +64,3 @@ void MallocHeader::print_block_on_error(outputStream* st, address bad_address) c os::print_hex_dump(st, from1, to2, 1); } } - -bool MallocHeader::get_stack(NativeCallStack& stack) const { - return MallocSiteTable::access_stack(stack, _mst_marker); -} diff --git a/src/hotspot/share/nmt/mallocHeader.hpp b/src/hotspot/share/nmt/mallocHeader.hpp index 6d847a22de3..9f9f7f97ea7 100644 --- a/src/hotspot/share/nmt/mallocHeader.hpp +++ b/src/hotspot/share/nmt/mallocHeader.hpp @@ -130,7 +130,6 @@ public: inline size_t size() const { return _size; } inline MEMFLAGS flags() const { return _flags; } inline uint32_t mst_marker() const { return _mst_marker; } - bool get_stack(NativeCallStack& stack) const; // Return the necessary data to deaccount the block with NMT. FreeInfo free_info() { diff --git a/src/hotspot/share/nmt/mallocSiteTable.hpp b/src/hotspot/share/nmt/mallocSiteTable.hpp index 47fe82b590a..ae9266f5369 100644 --- a/src/hotspot/share/nmt/mallocSiteTable.hpp +++ b/src/hotspot/share/nmt/mallocSiteTable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 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 @@ -131,8 +131,8 @@ class MallocSiteTable : AllStatic { // Access and copy a call stack from this table. Shared lock should be // acquired before access the entry. - static inline bool access_stack(NativeCallStack& stack, uint32_t marker) { - MallocSite* site = malloc_site(marker); + static inline bool access_stack(NativeCallStack& stack, const MallocHeader& header) { + MallocSite* site = malloc_site(header.mst_marker()); if (site != nullptr) { stack = *site->call_stack(); return true; diff --git a/src/hotspot/share/nmt/mallocTracker.cpp b/src/hotspot/share/nmt/mallocTracker.cpp index ab323b3bae6..021ce5d1332 100644 --- a/src/hotspot/share/nmt/mallocTracker.cpp +++ b/src/hotspot/share/nmt/mallocTracker.cpp @@ -299,7 +299,7 @@ bool MallocTracker::print_pointer_information(const void* p, outputStream* st) { block->size(), NMTUtil::flag_to_enum_name(block->flags())); if (MemTracker::tracking_level() == NMT_detail) { NativeCallStack ncs; - if (block->get_stack(ncs)) { + if (MallocSiteTable::access_stack(ncs, *block)) { ncs.print_on(st); st->cr(); }