< prev index next >

src/hotspot/share/utilities/nativeCallStack.hpp

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2014, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2014, 2018, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 49,70 **** * This number has impacts on how much memory to be used by native * memory tracking. * 2. The class is strict stack object, no heap or virtual memory can be allocated * from it. */ class NativeCallStack : public StackObj { ! public: ! static const NativeCallStack EMPTY_STACK; ! private: address _stack[NMT_TrackingStackDepth]; unsigned int _hash_value; ! public: NativeCallStack(int toSkip = 0, bool fillStack = false); NativeCallStack(address* pc, int frameCount); // if it is an empty stack inline bool is_empty() const { return _stack[0] == NULL; } --- 49,75 ---- * This number has impacts on how much memory to be used by native * memory tracking. * 2. The class is strict stack object, no heap or virtual memory can be allocated * from it. */ + class MemTracker; + class NativeCallStack : public StackObj { ! friend class MemTracker; ! private: address _stack[NMT_TrackingStackDepth]; unsigned int _hash_value; ! static NativeCallStack EMPTY_STACK; ! public: NativeCallStack(int toSkip = 0, bool fillStack = false); NativeCallStack(address* pc, int frameCount); + static inline const NativeCallStack& empty_stack() { + return EMPTY_STACK; + } // if it is an empty stack inline bool is_empty() const { return _stack[0] == NULL; }
< prev index next >