< prev index next >

src/hotspot/share/memory/metadataFactory.hpp

Print this page
@@ -1,7 +1,7 @@
  /*
-  * Copyright (c) 2010, 2023, Oracle and/or its affiliates. All rights reserved.
+  * Copyright (c) 2010, 2024, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.

@@ -46,10 +46,17 @@
        array->at_put(i, value);
      }
      return array;
    }
  
+   // Work-around -- see JDK-8331086.
+   // This API should be used for TrainingData only.
+   template <typename T>
+   static Array<T>* new_array_from_c_heap(int length, MEMFLAGS flags) {
+     return new (length, flags) Array<T>(length);
+   }
+ 
    template <typename T>
    static void free_array(ClassLoaderData* loader_data, Array<T>* data) {
      if (data != nullptr) {
        assert(loader_data != nullptr, "shouldn't pass null");
        assert(!data->is_shared(), "cannot deallocate array in shared spaces");
< prev index next >