src/hotspot/share/classfile/moduleEntry.cpp
changeset 58083 9046db64ca39
parent 54786 ebf733a324d4
equal deleted inserted replaced
58081:8b08eaf9a0eb 58083:9046db64ca39
   282 
   282 
   283 // When creating an unnamed module, this is called without holding the Module_lock.
   283 // When creating an unnamed module, this is called without holding the Module_lock.
   284 // This is okay because the unnamed module gets created before the ClassLoaderData
   284 // This is okay because the unnamed module gets created before the ClassLoaderData
   285 // is available to other threads.
   285 // is available to other threads.
   286 ModuleEntry* ModuleEntry::new_unnamed_module_entry(Handle module_handle, ClassLoaderData* cld) {
   286 ModuleEntry* ModuleEntry::new_unnamed_module_entry(Handle module_handle, ClassLoaderData* cld) {
   287   ModuleEntry* entry = (ModuleEntry*) NEW_C_HEAP_ARRAY(char, sizeof(ModuleEntry), mtModule);
   287   ModuleEntry* entry = NEW_C_HEAP_OBJ(ModuleEntry, mtModule);
   288 
   288 
   289   // Initialize everything BasicHashtable would
   289   // Initialize everything BasicHashtable would
   290   entry->set_next(NULL);
   290   entry->set_next(NULL);
   291   entry->set_hash(0);
   291   entry->set_hash(0);
   292   entry->set_literal(NULL);
   292   entry->set_literal(NULL);
   309   return entry;
   309   return entry;
   310 }
   310 }
   311 
   311 
   312 void ModuleEntry::delete_unnamed_module() {
   312 void ModuleEntry::delete_unnamed_module() {
   313   // Do not need unlink_entry() since the unnamed module is not in the hashtable
   313   // Do not need unlink_entry() since the unnamed module is not in the hashtable
   314   FREE_C_HEAP_ARRAY(char, this);
   314   FREE_C_HEAP_OBJ(this);
   315 }
   315 }
   316 
   316 
   317 ModuleEntryTable::ModuleEntryTable(int table_size)
   317 ModuleEntryTable::ModuleEntryTable(int table_size)
   318   : Hashtable<Symbol*, mtModule>(table_size, sizeof(ModuleEntry))
   318   : Hashtable<Symbol*, mtModule>(table_size, sizeof(ModuleEntry))
   319 {
   319 {