< prev index next >

src/share/vm/services/mallocTracker.hpp

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

@@ -139,10 +139,11 @@
 
 
  public:
   inline MallocMemory*  by_type(MEMFLAGS flags) {
     int index = NMTUtil::flag_to_index(flags);
+    assert(index >= 0 && index < mt_number_of_types, "Index out of bound");
     return &_malloc[index];
   }
 
   inline MallocMemory* by_index(int index) {
     assert(index >= 0, "Index out of bound");
< prev index next >