author | zgu |
Fri, 15 Nov 2019 15:33:34 -0500 | |
changeset 59113 | 700a2ad8fc19 |
parent 53244 | 9807daeb47c4 |
child 59118 | 89c44961a84f |
permissions | -rw-r--r-- |
25946 | 1 |
/* |
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
49364
diff
changeset
|
2 |
* Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. |
25946 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
* |
|
23 |
*/ |
|
24 |
||
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
49364
diff
changeset
|
25 |
#ifndef SHARE_SERVICES_MALLOCTRACKER_HPP |
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
49364
diff
changeset
|
26 |
#define SHARE_SERVICES_MALLOCTRACKER_HPP |
25946 | 27 |
|
28 |
#if INCLUDE_NMT |
|
29 |
||
30 |
#include "memory/allocation.hpp" |
|
31 |
#include "runtime/atomic.hpp" |
|
28953
75f0bfa6ea14
8068451: Kitchensink fails with assert(_size >= sz) failed: Negative size
coleenp
parents:
27615
diff
changeset
|
32 |
#include "runtime/threadCritical.hpp" |
25946 | 33 |
#include "services/nmtCommon.hpp" |
34 |
#include "utilities/nativeCallStack.hpp" |
|
35 |
||
36 |
/* |
|
37 |
* This counter class counts memory allocation and deallocation, |
|
38 |
* records total memory allocation size and number of allocations. |
|
39 |
* The counters are updated atomically. |
|
40 |
*/ |
|
49364
601146c66cad
8173070: Remove ValueObj class for allocation subclassing for runtime code
coleenp
parents:
48955
diff
changeset
|
41 |
class MemoryCounter { |
25946 | 42 |
private: |
46266
d5ccf56195af
8157709: NMT should use size_t version of Atomic::add
dholmes
parents:
28953
diff
changeset
|
43 |
volatile size_t _count; |
d5ccf56195af
8157709: NMT should use size_t version of Atomic::add
dholmes
parents:
28953
diff
changeset
|
44 |
volatile size_t _size; |
25946 | 45 |
|
46 |
DEBUG_ONLY(size_t _peak_count;) |
|
47 |
DEBUG_ONLY(size_t _peak_size; ) |
|
48 |
||
49 |
public: |
|
50 |
MemoryCounter() : _count(0), _size(0) { |
|
51 |
DEBUG_ONLY(_peak_count = 0;) |
|
52 |
DEBUG_ONLY(_peak_size = 0;) |
|
53 |
} |
|
54 |
||
55 |
inline void allocate(size_t sz) { |
|
46993
dd0f91c85ffc
8186476: Generalize Atomic::add with templates
eosterlund
parents:
46489
diff
changeset
|
56 |
Atomic::inc(&_count); |
25946 | 57 |
if (sz > 0) { |
46266
d5ccf56195af
8157709: NMT should use size_t version of Atomic::add
dholmes
parents:
28953
diff
changeset
|
58 |
Atomic::add(sz, &_size); |
25946 | 59 |
DEBUG_ONLY(_peak_size = MAX2(_peak_size, _size)); |
60 |
} |
|
61 |
DEBUG_ONLY(_peak_count = MAX2(_peak_count, _count);) |
|
62 |
} |
|
63 |
||
64 |
inline void deallocate(size_t sz) { |
|
46266
d5ccf56195af
8157709: NMT should use size_t version of Atomic::add
dholmes
parents:
28953
diff
changeset
|
65 |
assert(_count > 0, "Nothing allocated yet"); |
d5ccf56195af
8157709: NMT should use size_t version of Atomic::add
dholmes
parents:
28953
diff
changeset
|
66 |
assert(_size >= sz, "deallocation > allocated"); |
46993
dd0f91c85ffc
8186476: Generalize Atomic::add with templates
eosterlund
parents:
46489
diff
changeset
|
67 |
Atomic::dec(&_count); |
25946 | 68 |
if (sz > 0) { |
47634
6a0c42c40cd1
8188220: Remove Atomic::*_ptr() uses and overloads from hotspot
coleenp
parents:
47216
diff
changeset
|
69 |
Atomic::sub(sz, &_size); |
25946 | 70 |
} |
71 |
} |
|
72 |
||
59113
700a2ad8fc19
8204128: NMT might report incorrect numbers for Compiler area
zgu
parents:
53244
diff
changeset
|
73 |
inline void resize(ssize_t sz) { |
25946 | 74 |
if (sz != 0) { |
59113
700a2ad8fc19
8204128: NMT might report incorrect numbers for Compiler area
zgu
parents:
53244
diff
changeset
|
75 |
assert(sz >= 0 || _size >= size_t(-sz), "Must be"); |
46993
dd0f91c85ffc
8186476: Generalize Atomic::add with templates
eosterlund
parents:
46489
diff
changeset
|
76 |
Atomic::add(size_t(sz), &_size); |
25946 | 77 |
DEBUG_ONLY(_peak_size = MAX2(_size, _peak_size);) |
78 |
} |
|
79 |
} |
|
80 |
||
81 |
inline size_t count() const { return _count; } |
|
82 |
inline size_t size() const { return _size; } |
|
83 |
DEBUG_ONLY(inline size_t peak_count() const { return _peak_count; }) |
|
84 |
DEBUG_ONLY(inline size_t peak_size() const { return _peak_size; }) |
|
85 |
||
86 |
}; |
|
87 |
||
88 |
/* |
|
89 |
* Malloc memory used by a particular subsystem. |
|
90 |
* It includes the memory acquired through os::malloc() |
|
91 |
* call and arena's backing memory. |
|
92 |
*/ |
|
49364
601146c66cad
8173070: Remove ValueObj class for allocation subclassing for runtime code
coleenp
parents:
48955
diff
changeset
|
93 |
class MallocMemory { |
25946 | 94 |
private: |
95 |
MemoryCounter _malloc; |
|
96 |
MemoryCounter _arena; |
|
97 |
||
98 |
public: |
|
99 |
MallocMemory() { } |
|
100 |
||
101 |
inline void record_malloc(size_t sz) { |
|
102 |
_malloc.allocate(sz); |
|
103 |
} |
|
104 |
||
105 |
inline void record_free(size_t sz) { |
|
106 |
_malloc.deallocate(sz); |
|
107 |
} |
|
108 |
||
109 |
inline void record_new_arena() { |
|
110 |
_arena.allocate(0); |
|
111 |
} |
|
112 |
||
113 |
inline void record_arena_free() { |
|
114 |
_arena.deallocate(0); |
|
115 |
} |
|
116 |
||
59113
700a2ad8fc19
8204128: NMT might report incorrect numbers for Compiler area
zgu
parents:
53244
diff
changeset
|
117 |
inline void record_arena_size_change(ssize_t sz) { |
25946 | 118 |
_arena.resize(sz); |
119 |
} |
|
120 |
||
121 |
inline size_t malloc_size() const { return _malloc.size(); } |
|
122 |
inline size_t malloc_count() const { return _malloc.count();} |
|
123 |
inline size_t arena_size() const { return _arena.size(); } |
|
124 |
inline size_t arena_count() const { return _arena.count(); } |
|
125 |
||
126 |
DEBUG_ONLY(inline const MemoryCounter& malloc_counter() const { return _malloc; }) |
|
127 |
DEBUG_ONLY(inline const MemoryCounter& arena_counter() const { return _arena; }) |
|
128 |
}; |
|
129 |
||
130 |
class MallocMemorySummary; |
|
131 |
||
132 |
// A snapshot of malloc'd memory, includes malloc memory |
|
133 |
// usage by types and memory used by tracking itself. |
|
134 |
class MallocMemorySnapshot : public ResourceObj { |
|
135 |
friend class MallocMemorySummary; |
|
136 |
||
137 |
private: |
|
138 |
MallocMemory _malloc[mt_number_of_types]; |
|
139 |
MemoryCounter _tracking_header; |
|
140 |
||
141 |
||
142 |
public: |
|
143 |
inline MallocMemory* by_type(MEMFLAGS flags) { |
|
144 |
int index = NMTUtil::flag_to_index(flags); |
|
145 |
return &_malloc[index]; |
|
146 |
} |
|
147 |
||
148 |
inline MallocMemory* by_index(int index) { |
|
149 |
assert(index >= 0, "Index out of bound"); |
|
150 |
assert(index < mt_number_of_types, "Index out of bound"); |
|
151 |
return &_malloc[index]; |
|
152 |
} |
|
153 |
||
154 |
inline MemoryCounter* malloc_overhead() { |
|
155 |
return &_tracking_header; |
|
156 |
} |
|
157 |
||
158 |
// Total malloc'd memory amount |
|
159 |
size_t total() const; |
|
160 |
// Total malloc'd memory used by arenas |
|
161 |
size_t total_arena() const; |
|
162 |
||
26288 | 163 |
inline size_t thread_count() const { |
164 |
MallocMemorySnapshot* s = const_cast<MallocMemorySnapshot*>(this); |
|
165 |
return s->by_type(mtThreadStack)->malloc_count(); |
|
25946 | 166 |
} |
167 |
||
168 |
void copy_to(MallocMemorySnapshot* s) { |
|
28953
75f0bfa6ea14
8068451: Kitchensink fails with assert(_size >= sz) failed: Negative size
coleenp
parents:
27615
diff
changeset
|
169 |
// Need to make sure that mtChunks don't get deallocated while the |
75f0bfa6ea14
8068451: Kitchensink fails with assert(_size >= sz) failed: Negative size
coleenp
parents:
27615
diff
changeset
|
170 |
// copy is going on, because their size is adjusted using this |
75f0bfa6ea14
8068451: Kitchensink fails with assert(_size >= sz) failed: Negative size
coleenp
parents:
27615
diff
changeset
|
171 |
// buffer in make_adjustment(). |
75f0bfa6ea14
8068451: Kitchensink fails with assert(_size >= sz) failed: Negative size
coleenp
parents:
27615
diff
changeset
|
172 |
ThreadCritical tc; |
25946 | 173 |
s->_tracking_header = _tracking_header; |
174 |
for (int index = 0; index < mt_number_of_types; index ++) { |
|
175 |
s->_malloc[index] = _malloc[index]; |
|
176 |
} |
|
177 |
} |
|
178 |
||
179 |
// Make adjustment by subtracting chunks used by arenas |
|
180 |
// from total chunks to get total free chunk size |
|
181 |
void make_adjustment(); |
|
182 |
}; |
|
183 |
||
184 |
/* |
|
185 |
* This class is for collecting malloc statistics at summary level |
|
186 |
*/ |
|
187 |
class MallocMemorySummary : AllStatic { |
|
188 |
private: |
|
189 |
// Reserve memory for placement of MallocMemorySnapshot object |
|
190 |
static size_t _snapshot[CALC_OBJ_SIZE_IN_TYPE(MallocMemorySnapshot, size_t)]; |
|
191 |
||
192 |
public: |
|
193 |
static void initialize(); |
|
194 |
||
195 |
static inline void record_malloc(size_t size, MEMFLAGS flag) { |
|
196 |
as_snapshot()->by_type(flag)->record_malloc(size); |
|
197 |
} |
|
198 |
||
199 |
static inline void record_free(size_t size, MEMFLAGS flag) { |
|
200 |
as_snapshot()->by_type(flag)->record_free(size); |
|
201 |
} |
|
202 |
||
203 |
static inline void record_new_arena(MEMFLAGS flag) { |
|
204 |
as_snapshot()->by_type(flag)->record_new_arena(); |
|
205 |
} |
|
206 |
||
207 |
static inline void record_arena_free(MEMFLAGS flag) { |
|
208 |
as_snapshot()->by_type(flag)->record_arena_free(); |
|
209 |
} |
|
210 |
||
211 |
static inline void record_arena_size_change(long size, MEMFLAGS flag) { |
|
212 |
as_snapshot()->by_type(flag)->record_arena_size_change(size); |
|
213 |
} |
|
214 |
||
215 |
static void snapshot(MallocMemorySnapshot* s) { |
|
216 |
as_snapshot()->copy_to(s); |
|
217 |
s->make_adjustment(); |
|
218 |
} |
|
219 |
||
220 |
// Record memory used by malloc tracking header |
|
221 |
static inline void record_new_malloc_header(size_t sz) { |
|
222 |
as_snapshot()->malloc_overhead()->allocate(sz); |
|
223 |
} |
|
224 |
||
225 |
static inline void record_free_malloc_header(size_t sz) { |
|
226 |
as_snapshot()->malloc_overhead()->deallocate(sz); |
|
227 |
} |
|
228 |
||
229 |
// The memory used by malloc tracking headers |
|
230 |
static inline size_t tracking_overhead() { |
|
231 |
return as_snapshot()->malloc_overhead()->size(); |
|
232 |
} |
|
233 |
||
234 |
static MallocMemorySnapshot* as_snapshot() { |
|
235 |
return (MallocMemorySnapshot*)_snapshot; |
|
236 |
} |
|
237 |
}; |
|
238 |
||
239 |
||
240 |
/* |
|
241 |
* Malloc tracking header. |
|
242 |
* To satisfy malloc alignment requirement, NMT uses 2 machine words for tracking purpose, |
|
243 |
* which ensures 8-bytes alignment on 32-bit systems and 16-bytes on 64-bit systems (Product build). |
|
244 |
*/ |
|
245 |
||
49364
601146c66cad
8173070: Remove ValueObj class for allocation subclassing for runtime code
coleenp
parents:
48955
diff
changeset
|
246 |
class MallocHeader { |
25946 | 247 |
#ifdef _LP64 |
27469
34008cfb8994
8058251: assert(_count > 0) failed: Negative counter when running runtime/NMT/MallocTrackingVerify.java
ctornqvi
parents:
27162
diff
changeset
|
248 |
size_t _size : 64; |
25946 | 249 |
size_t _flags : 8; |
250 |
size_t _pos_idx : 16; |
|
251 |
size_t _bucket_idx: 40; |
|
27615
d7caba003432
8062870: src/share/vm/services/mallocTracker.hpp:64 assert(_count > 0) failed: Negative counter
coleenp
parents:
27469
diff
changeset
|
252 |
#define MAX_MALLOCSITE_TABLE_SIZE right_n_bits(40) |
d7caba003432
8062870: src/share/vm/services/mallocTracker.hpp:64 assert(_count > 0) failed: Negative counter
coleenp
parents:
27469
diff
changeset
|
253 |
#define MAX_BUCKET_LENGTH right_n_bits(16) |
25946 | 254 |
#else |
27469
34008cfb8994
8058251: assert(_count > 0) failed: Negative counter when running runtime/NMT/MallocTrackingVerify.java
ctornqvi
parents:
27162
diff
changeset
|
255 |
size_t _size : 32; |
25946 | 256 |
size_t _flags : 8; |
257 |
size_t _pos_idx : 8; |
|
258 |
size_t _bucket_idx: 16; |
|
27615
d7caba003432
8062870: src/share/vm/services/mallocTracker.hpp:64 assert(_count > 0) failed: Negative counter
coleenp
parents:
27469
diff
changeset
|
259 |
#define MAX_MALLOCSITE_TABLE_SIZE right_n_bits(16) |
d7caba003432
8062870: src/share/vm/services/mallocTracker.hpp:64 assert(_count > 0) failed: Negative counter
coleenp
parents:
27469
diff
changeset
|
260 |
#define MAX_BUCKET_LENGTH right_n_bits(8) |
25946 | 261 |
#endif // _LP64 |
262 |
||
263 |
public: |
|
27469
34008cfb8994
8058251: assert(_count > 0) failed: Negative counter when running runtime/NMT/MallocTrackingVerify.java
ctornqvi
parents:
27162
diff
changeset
|
264 |
MallocHeader(size_t size, MEMFLAGS flags, const NativeCallStack& stack, NMT_TrackingLevel level) { |
25946 | 265 |
assert(sizeof(MallocHeader) == sizeof(void*) * 2, |
266 |
"Wrong header size"); |
|
267 |
||
27469
34008cfb8994
8058251: assert(_count > 0) failed: Negative counter when running runtime/NMT/MallocTrackingVerify.java
ctornqvi
parents:
27162
diff
changeset
|
268 |
if (level == NMT_minimal) { |
34008cfb8994
8058251: assert(_count > 0) failed: Negative counter when running runtime/NMT/MallocTrackingVerify.java
ctornqvi
parents:
27162
diff
changeset
|
269 |
return; |
34008cfb8994
8058251: assert(_count > 0) failed: Negative counter when running runtime/NMT/MallocTrackingVerify.java
ctornqvi
parents:
27162
diff
changeset
|
270 |
} |
34008cfb8994
8058251: assert(_count > 0) failed: Negative counter when running runtime/NMT/MallocTrackingVerify.java
ctornqvi
parents:
27162
diff
changeset
|
271 |
|
25946 | 272 |
_flags = flags; |
273 |
set_size(size); |
|
27469
34008cfb8994
8058251: assert(_count > 0) failed: Negative counter when running runtime/NMT/MallocTrackingVerify.java
ctornqvi
parents:
27162
diff
changeset
|
274 |
if (level == NMT_detail) { |
34008cfb8994
8058251: assert(_count > 0) failed: Negative counter when running runtime/NMT/MallocTrackingVerify.java
ctornqvi
parents:
27162
diff
changeset
|
275 |
size_t bucket_idx; |
34008cfb8994
8058251: assert(_count > 0) failed: Negative counter when running runtime/NMT/MallocTrackingVerify.java
ctornqvi
parents:
27162
diff
changeset
|
276 |
size_t pos_idx; |
46489
40abcea5a9d5
8139673: NMT stack traces in output should show mtcomponent
zgu
parents:
46266
diff
changeset
|
277 |
if (record_malloc_site(stack, size, &bucket_idx, &pos_idx, flags)) { |
27469
34008cfb8994
8058251: assert(_count > 0) failed: Negative counter when running runtime/NMT/MallocTrackingVerify.java
ctornqvi
parents:
27162
diff
changeset
|
278 |
assert(bucket_idx <= MAX_MALLOCSITE_TABLE_SIZE, "Overflow bucket index"); |
34008cfb8994
8058251: assert(_count > 0) failed: Negative counter when running runtime/NMT/MallocTrackingVerify.java
ctornqvi
parents:
27162
diff
changeset
|
279 |
assert(pos_idx <= MAX_BUCKET_LENGTH, "Overflow bucket position index"); |
34008cfb8994
8058251: assert(_count > 0) failed: Negative counter when running runtime/NMT/MallocTrackingVerify.java
ctornqvi
parents:
27162
diff
changeset
|
280 |
_bucket_idx = bucket_idx; |
34008cfb8994
8058251: assert(_count > 0) failed: Negative counter when running runtime/NMT/MallocTrackingVerify.java
ctornqvi
parents:
27162
diff
changeset
|
281 |
_pos_idx = pos_idx; |
34008cfb8994
8058251: assert(_count > 0) failed: Negative counter when running runtime/NMT/MallocTrackingVerify.java
ctornqvi
parents:
27162
diff
changeset
|
282 |
} |
25946 | 283 |
} |
27469
34008cfb8994
8058251: assert(_count > 0) failed: Negative counter when running runtime/NMT/MallocTrackingVerify.java
ctornqvi
parents:
27162
diff
changeset
|
284 |
|
25946 | 285 |
MallocMemorySummary::record_malloc(size, flags); |
286 |
MallocMemorySummary::record_new_malloc_header(sizeof(MallocHeader)); |
|
287 |
} |
|
288 |
||
289 |
inline size_t size() const { return _size; } |
|
290 |
inline MEMFLAGS flags() const { return (MEMFLAGS)_flags; } |
|
291 |
bool get_stack(NativeCallStack& stack) const; |
|
292 |
||
293 |
// Cleanup tracking information before the memory is released. |
|
294 |
void release() const; |
|
295 |
||
296 |
private: |
|
297 |
inline void set_size(size_t size) { |
|
298 |
_size = size; |
|
299 |
} |
|
300 |
bool record_malloc_site(const NativeCallStack& stack, size_t size, |
|
46489
40abcea5a9d5
8139673: NMT stack traces in output should show mtcomponent
zgu
parents:
46266
diff
changeset
|
301 |
size_t* bucket_idx, size_t* pos_idx, MEMFLAGS flags) const; |
25946 | 302 |
}; |
303 |
||
304 |
||
305 |
// Main class called from MemTracker to track malloc activities |
|
306 |
class MallocTracker : AllStatic { |
|
307 |
public: |
|
308 |
// Initialize malloc tracker for specific tracking level |
|
309 |
static bool initialize(NMT_TrackingLevel level); |
|
310 |
||
311 |
static bool transition(NMT_TrackingLevel from, NMT_TrackingLevel to); |
|
312 |
||
313 |
// malloc tracking header size for specific tracking level |
|
314 |
static inline size_t malloc_header_size(NMT_TrackingLevel level) { |
|
315 |
return (level == NMT_off) ? 0 : sizeof(MallocHeader); |
|
316 |
} |
|
317 |
||
318 |
// Parameter name convention: |
|
319 |
// memblock : the beginning address for user data |
|
320 |
// malloc_base: the beginning address that includes malloc tracking header |
|
321 |
// |
|
322 |
// The relationship: |
|
323 |
// memblock = (char*)malloc_base + sizeof(nmt header) |
|
324 |
// |
|
325 |
||
326 |
// Record malloc on specified memory block |
|
327 |
static void* record_malloc(void* malloc_base, size_t size, MEMFLAGS flags, |
|
328 |
const NativeCallStack& stack, NMT_TrackingLevel level); |
|
329 |
||
330 |
// Record free on specified memory block |
|
331 |
static void* record_free(void* memblock); |
|
332 |
||
333 |
// Offset memory address to header address |
|
334 |
static inline void* get_base(void* memblock); |
|
335 |
static inline void* get_base(void* memblock, NMT_TrackingLevel level) { |
|
336 |
if (memblock == NULL || level == NMT_off) return memblock; |
|
337 |
return (char*)memblock - malloc_header_size(level); |
|
338 |
} |
|
339 |
||
340 |
// Get memory size |
|
341 |
static inline size_t get_size(void* memblock) { |
|
342 |
MallocHeader* header = malloc_header(memblock); |
|
343 |
return header->size(); |
|
344 |
} |
|
345 |
||
346 |
// Get memory type |
|
347 |
static inline MEMFLAGS get_flags(void* memblock) { |
|
348 |
MallocHeader* header = malloc_header(memblock); |
|
349 |
return header->flags(); |
|
350 |
} |
|
351 |
||
352 |
// Get header size |
|
353 |
static inline size_t get_header_size(void* memblock) { |
|
354 |
return (memblock == NULL) ? 0 : sizeof(MallocHeader); |
|
355 |
} |
|
356 |
||
357 |
static inline void record_new_arena(MEMFLAGS flags) { |
|
358 |
MallocMemorySummary::record_new_arena(flags); |
|
359 |
} |
|
360 |
||
361 |
static inline void record_arena_free(MEMFLAGS flags) { |
|
362 |
MallocMemorySummary::record_arena_free(flags); |
|
363 |
} |
|
364 |
||
59113
700a2ad8fc19
8204128: NMT might report incorrect numbers for Compiler area
zgu
parents:
53244
diff
changeset
|
365 |
static inline void record_arena_size_change(ssize_t size, MEMFLAGS flags) { |
25946 | 366 |
MallocMemorySummary::record_arena_size_change(size, flags); |
367 |
} |
|
368 |
private: |
|
369 |
static inline MallocHeader* malloc_header(void *memblock) { |
|
370 |
assert(memblock != NULL, "NULL pointer"); |
|
371 |
MallocHeader* header = (MallocHeader*)((char*)memblock - sizeof(MallocHeader)); |
|
372 |
return header; |
|
373 |
} |
|
374 |
}; |
|
375 |
||
376 |
#endif // INCLUDE_NMT |
|
377 |
||
378 |
||
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
49364
diff
changeset
|
379 |
#endif // SHARE_SERVICES_MALLOCTRACKER_HPP |