< prev index next >

src/share/vm/utilities/nativeCallStack.cpp

Print this page
rev 7876 : [mq]: nmtfix

@@ -53,10 +53,11 @@
     _stack[index] = pc[index];
   }
   for (; index < NMT_TrackingStackDepth; index ++) {
     _stack[index] = NULL;
   }
+  _hash_value = 0;
 }
 
 // number of stack frames captured
 int NativeCallStack::frames() const {
   int index;

@@ -67,11 +68,11 @@
   }
   return index;
 }
 
 // Hash code. Any better algorithm?
-int NativeCallStack::hash() const {
+unsigned int NativeCallStack::hash() const {
   long hash_val = _hash_value;
   if (hash_val == 0) {
     long pc;
     int  index;
     for (index = 0; index < NMT_TrackingStackDepth; index ++) {

@@ -79,11 +80,11 @@
       if (pc == 0) break;
       hash_val += pc;
     }
 
     NativeCallStack* p = const_cast<NativeCallStack*>(this);
-    p->_hash_value = (int)(hash_val & 0xFFFFFFFF);
+    p->_hash_value = (unsigned int)(hash_val & 0xFFFFFFFF);
   }
   return _hash_value;
 }
 
 void NativeCallStack::print_on(outputStream* out) const {
< prev index next >