Mercurial > hg > truffle
diff src/share/vm/utilities/resourceHash.hpp @ 14660:3c6ae9109a86
8035946: Use ResourceHashtable for dependency checking
Summary: Use ResourceHashtable for dependency checking and delete GenericHashtable
Reviewed-by: kvn, coleenp
author | anoll |
---|---|
date | Mon, 03 Mar 2014 08:04:14 +0100 |
parents | bdd155477289 |
children | 92aa6797d639 |
line wrap: on
line diff
--- a/src/share/vm/utilities/resourceHash.hpp Fri Feb 28 09:30:20 2014 -0800 +++ b/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; } }