diff src/share/vm/utilities/resourceHash.hpp @ 14702:d4dd5204c0aa

Merge
author ehelin
date Fri, 14 Mar 2014 13:27:18 +0100
parents 3c6ae9109a86
children 92aa6797d639
line wrap: on
line diff
--- a/src/share/vm/utilities/resourceHash.hpp	Fri Mar 14 09:18:39 2014 +0100
+++ b/src/share/vm/utilities/resourceHash.hpp	Fri Mar 14 13:27:18 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;
     }
   }