hotspot/src/share/vm/utilities/resourceHash.hpp
changeset 23187 0f438571f278
parent 22827 07d991d45a51
child 33754 49614940dafc
--- a/hotspot/src/share/vm/utilities/resourceHash.hpp	Fri Feb 28 09:30:20 2014 -0800
+++ b/hotspot/src/share/vm/utilities/resourceHash.hpp	Mon Mar 03 08:04:14 2014 +0100
@@ -105,14 +105,20 @@
     }
   }
 
-  // Inserts or replaces a value in the table
-  void put(K const& key, V const& value) {
+ /**
+  * Inserts or replaces a value in the table.
+  * @return: true:  if a new item is added
+  *          false: if the item already existed and the value is updated
+  */
+  bool put(K const& key, V const& value) {
     unsigned hv = HASH(key);
     Node** ptr = lookup_node(hv, key);
     if (*ptr != NULL) {
       (*ptr)->_value = value;
+      return false;
     } else {
       *ptr = new Node(hv, key, value);
+      return true;
     }
   }