src/hotspot/share/memory/allocation.inline.hpp
changeset 49590 66c32f2a7f10
parent 49465 4881673579b7
child 53244 9807daeb47c4
equal deleted inserted replaced
49487:bde392011cd8 49590:66c32f2a7f10
   103 E* MallocArrayAllocator<E>::allocate(size_t length, MEMFLAGS flags) {
   103 E* MallocArrayAllocator<E>::allocate(size_t length, MEMFLAGS flags) {
   104   return (E*)AllocateHeap(size_for(length), flags);
   104   return (E*)AllocateHeap(size_for(length), flags);
   105 }
   105 }
   106 
   106 
   107 template<class E>
   107 template<class E>
   108 void MallocArrayAllocator<E>::free(E* addr, size_t /*length*/) {
   108 void MallocArrayAllocator<E>::free(E* addr) {
   109   FreeHeap(addr);
   109   FreeHeap(addr);
   110 }
   110 }
   111 
   111 
   112 template <class E>
   112 template <class E>
   113 bool ArrayAllocator<E>::should_use_malloc(size_t length) {
   113 bool ArrayAllocator<E>::should_use_malloc(size_t length) {
   150   return new_addr;
   150   return new_addr;
   151 }
   151 }
   152 
   152 
   153 template<class E>
   153 template<class E>
   154 void ArrayAllocator<E>::free_malloc(E* addr, size_t length) {
   154 void ArrayAllocator<E>::free_malloc(E* addr, size_t length) {
   155   MallocArrayAllocator<E>::free(addr, length);
   155   MallocArrayAllocator<E>::free(addr);
   156 }
   156 }
   157 
   157 
   158 template<class E>
   158 template<class E>
   159 void ArrayAllocator<E>::free_mmap(E* addr, size_t length) {
   159 void ArrayAllocator<E>::free_mmap(E* addr, size_t length) {
   160   MmapArrayAllocator<E>::free(addr, length);
   160   MmapArrayAllocator<E>::free(addr, length);