77 } |
77 } |
78 |
78 |
79 // Deallocation method for metadata |
79 // Deallocation method for metadata |
80 template <class T> |
80 template <class T> |
81 static void free_metadata(ClassLoaderData* loader_data, T md) { |
81 static void free_metadata(ClassLoaderData* loader_data, T md) { |
|
82 if (DumpSharedSpaces) { |
|
83 // FIXME: the freeing code is buggy, especially when PrintSharedSpaces is enabled. |
|
84 // Disable for now -- this means if you specify bad classes in your classlist you |
|
85 // may have wasted space inside the archive. |
|
86 return; |
|
87 } |
82 if (md != NULL) { |
88 if (md != NULL) { |
83 assert(loader_data != NULL, "shouldn't pass null"); |
89 assert(loader_data != NULL, "shouldn't pass null"); |
84 int size = md->size(); |
90 int size = md->size(); |
85 // Call metadata's deallocate function which will call deallocate fields |
91 // Call metadata's deallocate function which will call deallocate fields |
86 assert(!DumpSharedSpaces, "cannot deallocate metadata when dumping CDS archive"); |
92 assert(!DumpSharedSpaces, "cannot deallocate metadata when dumping CDS archive"); |