src/share/vm/utilities/resourceHash.hpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/src/share/vm/utilities/resourceHash.hpp Fri Feb 28 09:32:59 2014
--- new/src/share/vm/utilities/resourceHash.hpp Fri Feb 28 09:32:59 2014
*** 103,120 ****
--- 103,126 ----
} else {
return NULL;
}
}
// 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;
}
}
// ITER contains bool do_entry(K const&, V const&), which will be
// called for each entry in the table. If do_entry() returns false,
src/share/vm/utilities/resourceHash.hpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File