1.1 --- a/src/share/vm/memory/metadataFactory.hpp Sat Oct 12 13:09:18 2013 -0400 1.2 +++ b/src/share/vm/memory/metadataFactory.hpp Sat Oct 12 15:39:16 2013 -0400 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -65,6 +65,7 @@ 1.11 static void free_array(ClassLoaderData* loader_data, Array<T>* data) { 1.12 if (data != NULL) { 1.13 assert(loader_data != NULL, "shouldn't pass null"); 1.14 + assert(!data->is_shared(), "cannot deallocate array in shared spaces"); 1.15 int size = data->size(); 1.16 if (DumpSharedSpaces) { 1.17 loader_data->ro_metaspace()->deallocate((MetaWord*)data, size, false); 1.18 @@ -83,6 +84,7 @@ 1.19 // Call metadata's deallocate function which will call deallocate fields 1.20 assert(!DumpSharedSpaces, "cannot deallocate metadata when dumping CDS archive"); 1.21 assert(!md->on_stack(), "can't deallocate things on stack"); 1.22 + assert(!md->is_shared(), "cannot deallocate if in shared spaces"); 1.23 md->deallocate_contents(loader_data); 1.24 loader_data->metaspace_non_null()->deallocate((MetaWord*)md, size, md->is_klass()); 1.25 }