< prev index next >

src/hotspot/share/services/mallocTracker.hpp

Print this page

        

*** 53,80 **** } inline void allocate(size_t sz) { Atomic::inc(&_count); if (sz > 0) { ! Atomic::add(sz, &_size); DEBUG_ONLY(_peak_size = MAX2(_peak_size, _size)); } DEBUG_ONLY(_peak_count = MAX2(_peak_count, _count);) } inline void deallocate(size_t sz) { assert(_count > 0, "Nothing allocated yet"); assert(_size >= sz, "deallocation > allocated"); Atomic::dec(&_count); if (sz > 0) { ! Atomic::sub(sz, &_size); } } inline void resize(long sz) { if (sz != 0) { ! Atomic::add(size_t(sz), &_size); DEBUG_ONLY(_peak_size = MAX2(_size, _peak_size);) } } inline size_t count() const { return _count; } --- 53,80 ---- } inline void allocate(size_t sz) { Atomic::inc(&_count); if (sz > 0) { ! Atomic::add(&_size, sz); DEBUG_ONLY(_peak_size = MAX2(_peak_size, _size)); } DEBUG_ONLY(_peak_count = MAX2(_peak_count, _count);) } inline void deallocate(size_t sz) { assert(_count > 0, "Nothing allocated yet"); assert(_size >= sz, "deallocation > allocated"); Atomic::dec(&_count); if (sz > 0) { ! Atomic::sub(&_size, sz); } } inline void resize(long sz) { if (sz != 0) { ! Atomic::add(&_size, size_t(sz)); DEBUG_ONLY(_peak_size = MAX2(_size, _peak_size);) } } inline size_t count() const { return _count; }
< prev index next >