8333653: Remove MallocHeader::get_stack

Reviewed-by: stuefe
This commit is contained in:
Johan Sjölen 2024-06-07 12:17:52 +00:00
parent 40b2fbd820
commit 486dee2cf4
4 changed files with 5 additions and 10 deletions

View File

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

View File

@ -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() {

View File

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

View File

@ -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();
}