hotspot/src/share/vm/memory/allocation.hpp
changeset 37096 42437cf54027
parent 37092 0e56e3c9d545
child 37491 edf4cc53f5a3
--- a/hotspot/src/share/vm/memory/allocation.hpp	Mon Mar 14 20:20:18 2016 +0100
+++ b/hotspot/src/share/vm/memory/allocation.hpp	Wed Mar 09 17:03:04 2016 +0100
@@ -716,9 +716,6 @@
  private:
   static bool should_use_malloc(size_t length);
 
-  static size_t size_for_malloc(size_t length);
-  static size_t size_for_mmap(size_t length);
-
   static E* allocate_malloc(size_t length);
   static E* allocate_mmap(size_t length);
 
@@ -731,4 +728,26 @@
   static void free(E* addr, size_t length);
 };
 
+// Uses mmaped memory for all allocations. All allocations are initially
+// zero-filled. No pre-touching.
+template <class E, MEMFLAGS F>
+class MmapArrayAllocator : public AllStatic {
+ private:
+  static size_t size_for(size_t length);
+
+ public:
+  static E* allocate(size_t length);
+  static void free(E* addr, size_t length);
+};
+
+// Uses malloc:ed memory for all allocations.
+template <class E, MEMFLAGS F>
+class MallocArrayAllocator : public AllStatic {
+ public:
+  static size_t size_for(size_t length);
+
+  static E* allocate(size_t length);
+  static void free(E* addr, size_t length);
+};
+
 #endif // SHARE_VM_MEMORY_ALLOCATION_HPP