mirror of
https://github.com/openjdk/jdk.git
synced 2026-07-28 03:43:21 +00:00
8371778: Make MallocMemorySummary::_snapshot a DeferredStatic
Reviewed-by: phubner, azafari
This commit is contained in:
parent
f946449997
commit
36b66e13c8
@ -45,7 +45,7 @@
|
||||
#include "utilities/ostream.hpp"
|
||||
#include "utilities/vmError.hpp"
|
||||
|
||||
MallocMemorySnapshot MallocMemorySummary::_snapshot;
|
||||
DeferredStatic<MallocMemorySnapshot> MallocMemorySummary::_snapshot;
|
||||
|
||||
void MemoryCounter::update_peak(size_t size, size_t cnt) {
|
||||
size_t peak_sz = peak_size();
|
||||
@ -101,7 +101,7 @@ void MallocMemorySnapshot::make_adjustment() {
|
||||
}
|
||||
|
||||
void MallocMemorySummary::initialize() {
|
||||
// Uses placement new operator to initialize static area.
|
||||
_snapshot.initialize();
|
||||
MallocLimitHandler::initialize(MallocLimit);
|
||||
}
|
||||
|
||||
|
||||
@ -30,6 +30,7 @@
|
||||
#include "nmt/memTag.hpp"
|
||||
#include "nmt/nmtCommon.hpp"
|
||||
#include "runtime/atomicAccess.hpp"
|
||||
#include "utilities/deferredStatic.hpp"
|
||||
#include "utilities/nativeCallStack.hpp"
|
||||
|
||||
class outputStream;
|
||||
@ -204,7 +205,7 @@ class MallocMemorySnapshot {
|
||||
class MallocMemorySummary : AllStatic {
|
||||
private:
|
||||
// Reserve memory for placement of MallocMemorySnapshot object
|
||||
static MallocMemorySnapshot _snapshot;
|
||||
static DeferredStatic<MallocMemorySnapshot> _snapshot;
|
||||
static bool _have_limits;
|
||||
|
||||
// Called when a total limit break was detected.
|
||||
@ -251,7 +252,7 @@ class MallocMemorySummary : AllStatic {
|
||||
}
|
||||
|
||||
static MallocMemorySnapshot* as_snapshot() {
|
||||
return &_snapshot;
|
||||
return _snapshot.get();
|
||||
}
|
||||
|
||||
// MallocLimit: returns true if allocating s bytes on f would trigger
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user