< prev index next >

src/share/vm/services/mallocTracker.cpp

Print this page
rev 12318 : 8167650: NMT should check for invalid MEMFLAGS
Reviewed-by: dholmes, mockner, cjplummer

@@ -53,10 +53,11 @@
 // Make adjustment by subtracting chunks used by arenas
 // from total chunks to get total free chunk size
 void MallocMemorySnapshot::make_adjustment() {
   size_t arena_size = total_arena();
   int chunk_idx = NMTUtil::flag_to_index(mtChunk);
+  assert(chunk_idx >= 0 && chunk_idx < mt_number_of_types, "Index out of bound.");
   _malloc[chunk_idx].record_free(arena_size);
 }
 
 
 void MallocMemorySummary::initialize() {
< prev index next >