src/share/vm/memory/padded.inline.hpp

changeset 6409
5479cb006184
parent 6403
d7070f371770
child 6876
710a3c8b516e
     1.1 --- a/src/share/vm/memory/padded.inline.hpp	Mon Mar 24 15:30:56 2014 +0100
     1.2 +++ b/src/share/vm/memory/padded.inline.hpp	Mon Mar 24 15:31:00 2014 +0100
     1.3 @@ -76,3 +76,13 @@
     1.4  
     1.5    return result;
     1.6  }
     1.7 +
     1.8 +template <class T, MEMFLAGS flags, size_t alignment>
     1.9 +T* PaddedPrimitiveArray<T, flags, alignment>::create_unfreeable(size_t length) {
    1.10 +  // Allocate a chunk of memory large enough to allow for some alignment.
    1.11 +  void* chunk = AllocateHeap(length * sizeof(T) + alignment, flags);
    1.12 +
    1.13 +  memset(chunk, 0, length * sizeof(T) + alignment);
    1.14 +
    1.15 +  return (T*)align_pointer_up(chunk, alignment);
    1.16 +}

mercurial