< prev index next >

src/hotspot/share/utilities/hashtable.hpp

Print this page

@@ -27,10 +27,11 @@
 
 #include "memory/allocation.hpp"
 #include "oops/oop.hpp"
 #include "oops/symbol.hpp"
 #include "runtime/handles.hpp"
+#include "utilities/growableArray.hpp"
 
 // This is a generic hashtable, designed to be used for the symbol
 // and string tables.
 //
 // It is implemented as an open hash table with a fixed number of buckets.

@@ -143,10 +144,11 @@
 
 public:
   BasicHashtable(int table_size, int entry_size);
   BasicHashtable(int table_size, int entry_size,
                  HashtableBucket<F>* buckets, int number_of_entries);
+  ~BasicHashtable();
 
   // Bucket handling
   int hash_to_index(unsigned int full_hash) const {
     int h = full_hash % _table_size;
     assert(h >= 0 && h < _table_size, "Illegal hash value");

@@ -160,10 +162,11 @@
   BasicHashtableEntry<F>* volatile _free_list;
   char*             _first_free_entry;
   char*             _end_block;
   int               _entry_size;
   volatile int      _number_of_entries;
+  GrowableArray<char*>* _entry_blocks;
 
 protected:
 
   void initialize(int table_size, int entry_size, int number_of_entries);
 

@@ -289,12 +292,11 @@
 };
 
 // A subclass of BasicHashtable that allows you to do a simple K -> V mapping
 // without using tons of boilerplate code.
 template<
-    typename K, typename V,
-    MEMFLAGS F = mtInternal,
+    typename K, typename V, MEMFLAGS F,
     unsigned (*HASH)  (K const&)           = primitive_hash<K>,
     bool     (*EQUALS)(K const&, K const&) = primitive_equals<K>
     >
 class KVHashtable : public BasicHashtable<F> {
   class KVHashtableEntry : public BasicHashtableEntry<F> {
< prev index next >