comparison src/share/vm/memory/padded.inline.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
comparison
equal deleted inserted replaced
17759:bc22cbb8b45a 17760:5479cb006184
74 *allocation_size = total_size; 74 *allocation_size = total_size;
75 } 75 }
76 76
77 return result; 77 return result;
78 } 78 }
79
80 template <class T, MEMFLAGS flags, size_t alignment>
81 T* PaddedPrimitiveArray<T, flags, alignment>::create_unfreeable(size_t length) {
82 // Allocate a chunk of memory large enough to allow for some alignment.
83 void* chunk = AllocateHeap(length * sizeof(T) + alignment, flags);
84
85 memset(chunk, 0, length * sizeof(T) + alignment);
86
87 return (T*)align_pointer_up(chunk, alignment);
88 }