< prev index next >

src/hotspot/share/utilities/hashtable.cpp

Print this page

*** 85,95 **** entry->set_literal(obj); return entry; } // Version of hashtable entry allocation that allocates in the C heap directly. ! // The allocator in blocks is preferable but doesn't have free semantics. template <class T, MEMFLAGS F> HashtableEntry<T, F>* Hashtable<T, F>::allocate_new_entry(unsigned int hashValue, T obj) { HashtableEntry<T, F>* entry = (HashtableEntry<T, F>*) NEW_C_HEAP_ARRAY(char, this->entry_size(), F); entry->set_hash(hashValue); entry->set_literal(obj); --- 85,97 ---- entry->set_literal(obj); return entry; } // Version of hashtable entry allocation that allocates in the C heap directly. ! // The block allocator in BasicHashtable has less fragmentation, but the memory is not freed until ! // the whole table is freed. Use allocate_new_entry() if you want to individually free the memory ! // used by each entry template <class T, MEMFLAGS F> HashtableEntry<T, F>* Hashtable<T, F>::allocate_new_entry(unsigned int hashValue, T obj) { HashtableEntry<T, F>* entry = (HashtableEntry<T, F>*) NEW_C_HEAP_ARRAY(char, this->entry_size(), F); entry->set_hash(hashValue); entry->set_literal(obj);
< prev index next >