< prev index next >

src/hotspot/share/memory/padded.hpp

Print this page
rev 50098 : [mq]: 8202842-g1-footprint-regressions


  87           char _pad_buf##id[(alignment) - (size)]
  88 
  89 // Helper class to create an array of PaddedEnd<T> objects. All elements will
  90 // start at a multiple of alignment and the size will be aligned to alignment.
  91 template <class T, MEMFLAGS flags, size_t alignment = DEFAULT_CACHE_LINE_SIZE>
  92 class PaddedArray {
  93  public:
  94   // Creates an aligned padded array.
  95   // The memory can't be deleted since the raw memory chunk is not returned.
  96   static PaddedEnd<T>* create_unfreeable(uint length);
  97 };
  98 
  99 // Helper class to create an array of references to arrays of primitive types
 100 // Both the array of references and the data arrays are aligned to the given
 101 // alignment. The allocated memory is zero-filled.
 102 template <class T, MEMFLAGS flags, size_t alignment = DEFAULT_CACHE_LINE_SIZE>
 103 class Padded2DArray {
 104  public:
 105   // Creates an aligned padded 2D array.
 106   // The memory cannot be deleted since the raw memory chunk is not returned.


 107   static T** create_unfreeable(uint rows, uint columns, size_t* allocation_size = NULL);
 108 };
 109 
 110 // Helper class to create an array of T objects. The array as a whole will
 111 // start at a multiple of alignment and its size will be aligned to alignment.
 112 template <class T, MEMFLAGS flags, size_t alignment = DEFAULT_CACHE_LINE_SIZE>
 113 class PaddedPrimitiveArray {
 114  public:
 115   static T* create_unfreeable(size_t length);
 116 };
 117 
 118 #endif // SHARE_VM_MEMORY_PADDED_HPP


  87           char _pad_buf##id[(alignment) - (size)]
  88 
  89 // Helper class to create an array of PaddedEnd<T> objects. All elements will
  90 // start at a multiple of alignment and the size will be aligned to alignment.
  91 template <class T, MEMFLAGS flags, size_t alignment = DEFAULT_CACHE_LINE_SIZE>
  92 class PaddedArray {
  93  public:
  94   // Creates an aligned padded array.
  95   // The memory can't be deleted since the raw memory chunk is not returned.
  96   static PaddedEnd<T>* create_unfreeable(uint length);
  97 };
  98 
  99 // Helper class to create an array of references to arrays of primitive types
 100 // Both the array of references and the data arrays are aligned to the given
 101 // alignment. The allocated memory is zero-filled.
 102 template <class T, MEMFLAGS flags, size_t alignment = DEFAULT_CACHE_LINE_SIZE>
 103 class Padded2DArray {
 104  public:
 105   // Creates an aligned padded 2D array.
 106   // The memory cannot be deleted since the raw memory chunk is not returned.
 107   // Always uses mmap to reserve memory. Only the first few pages with the index to
 108   // the rows are touched. Allocation size should be "large" to cover page overhead.
 109   static T** create_unfreeable(uint rows, uint columns, size_t* allocation_size = NULL);
 110 };
 111 
 112 // Helper class to create an array of T objects. The array as a whole will
 113 // start at a multiple of alignment and its size will be aligned to alignment.
 114 template <class T, MEMFLAGS flags, size_t alignment = DEFAULT_CACHE_LINE_SIZE>
 115 class PaddedPrimitiveArray {
 116  public:
 117   static T* create_unfreeable(size_t length);
 118 };
 119 
 120 #endif // SHARE_VM_MEMORY_PADDED_HPP
< prev index next >