@@ -872,7 +872,7 @@ size_t Metaspace::max_allocation_word_size() {
872872// is suitable for calling from non-Java threads.
873873// Callers are responsible for checking null.
874874MetaWord* Metaspace::allocate (ClassLoaderData* loader_data, size_t word_size,
875- MetaspaceObj::Type type, bool use_class_space ) {
875+ MetaspaceObj::Type type) {
876876 assert (word_size <= Metaspace::max_allocation_word_size (),
877877 " allocation size too large (%zu)" , word_size);
878878
@@ -882,7 +882,7 @@ MetaWord* Metaspace::allocate(ClassLoaderData* loader_data, size_t word_size,
882882 // Deal with concurrent unloading failed allocation starvation
883883 MetaspaceCriticalAllocation::block_if_concurrent_purge ();
884884
885- MetadataType mdtype = use_class_space ? ClassType : NonClassType;
885+ MetadataType mdtype = (type == MetaspaceObj::ClassType) ? ClassType : NonClassType;
886886
887887 // Try to allocate metadata.
888888 MetaWord* result = loader_data->metaspace_non_null ()->allocate (word_size, mdtype);
@@ -906,18 +906,18 @@ MetaWord* Metaspace::allocate(ClassLoaderData* loader_data, size_t word_size,
906906}
907907
908908MetaWord* Metaspace::allocate (ClassLoaderData* loader_data, size_t word_size,
909- MetaspaceObj::Type type, bool use_class_space, TRAPS) {
909+ MetaspaceObj::Type type, TRAPS) {
910910
911911 if (HAS_PENDING_EXCEPTION) {
912912 assert (false , " Should not allocate with exception pending" );
913913 return nullptr ; // caller does a CHECK_NULL too
914914 }
915915 assert (!THREAD->owns_locks (), " allocating metaspace while holding mutex" );
916916
917- MetaWord* result = allocate (loader_data, word_size, type, use_class_space );
917+ MetaWord* result = allocate (loader_data, word_size, type);
918918
919919 if (result == nullptr ) {
920- MetadataType mdtype = use_class_space ? ClassType : NonClassType;
920+ MetadataType mdtype = (type == MetaspaceObj::ClassType) ? ClassType : NonClassType;
921921 tracer ()->report_metaspace_allocation_failure (loader_data, word_size, type, mdtype);
922922
923923 // Allocation failed.
0 commit comments