diff src/share/vm/memory/padded.hpp @ 17760:5479cb006184

8036860: Pad and cache-align the BiasedMappedArray Summary: Pad and cache-align BiasedMappedArray instances by default to avoid performance variability problems due to false sharing, as instances of this data structures are typically used for performance sensitive code. Reviewed-by: brutisso, stefank
author tschatzl
date Mon, 24 Mar 2014 15:31:00 +0100
parents d7070f371770
children
line wrap: on
line diff
--- a/src/share/vm/memory/padded.hpp	Mon Mar 24 15:30:56 2014 +0100
+++ b/src/share/vm/memory/padded.hpp	Mon Mar 24 15:31:00 2014 +0100
@@ -101,4 +101,12 @@
   static T** create_unfreeable(uint rows, uint columns, size_t* allocation_size = NULL);
 };
 
+// Helper class to create an array of T objects. The array as a whole will
+// start at a multiple of alignment and its size will be aligned to alignment.
+template <class T, MEMFLAGS flags, size_t alignment = DEFAULT_CACHE_LINE_SIZE>
+class PaddedPrimitiveArray {
+ public:
+  static T* create_unfreeable(size_t length);
+};
+
 #endif // SHARE_VM_MEMORY_PADDED_HPP