diff a/src/hotspot/share/classfile/moduleEntry.cpp b/src/hotspot/share/classfile/moduleEntry.cpp --- a/src/hotspot/share/classfile/moduleEntry.cpp +++ b/src/hotspot/share/classfile/moduleEntry.cpp @@ -282,11 +282,11 @@ // When creating an unnamed module, this is called without holding the Module_lock. // This is okay because the unnamed module gets created before the ClassLoaderData // is available to other threads. ModuleEntry* ModuleEntry::new_unnamed_module_entry(Handle module_handle, ClassLoaderData* cld) { - ModuleEntry* entry = (ModuleEntry*) NEW_C_HEAP_ARRAY(char, sizeof(ModuleEntry), mtModule); + ModuleEntry* entry = NEW_C_HEAP_OBJ(ModuleEntry, mtModule); // Initialize everything BasicHashtable would entry->set_next(NULL); entry->set_hash(0); entry->set_literal(NULL); @@ -309,11 +309,11 @@ return entry; } void ModuleEntry::delete_unnamed_module() { // Do not need unlink_entry() since the unnamed module is not in the hashtable - FREE_C_HEAP_ARRAY(char, this); + FREE_C_HEAP_OBJ(this); } ModuleEntryTable::ModuleEntryTable(int table_size) : Hashtable(table_size, sizeof(ModuleEntry)) {