hotspot/src/share/vm/memory/allocation.hpp
changeset 16682 4e30a46f6b76
parent 15452 3bfde2dea09d
child 17026 72b2233861f1
child 17006 b9bfa72b7dda
child 18055 ba8c01e0d016
equal deleted inserted replaced
16681:d64161ca3e3c 16682:4e30a46f6b76
   609 public:
   609 public:
   610   ReallocMark()   PRODUCT_RETURN;
   610   ReallocMark()   PRODUCT_RETURN;
   611   void check()    PRODUCT_RETURN;
   611   void check()    PRODUCT_RETURN;
   612 };
   612 };
   613 
   613 
       
   614 // Helper class to allocate arrays that may become large.
       
   615 // Uses the OS malloc for allocations smaller than ArrayAllocatorMallocLimit
       
   616 // and uses mapped memory for larger allocations.
       
   617 // Most OS mallocs do something similar but Solaris malloc does not revert
       
   618 // to mapped memory for large allocations. By default ArrayAllocatorMallocLimit
       
   619 // is set so that we always use malloc except for Solaris where we set the
       
   620 // limit to get mapped memory.
       
   621 template <class E, MEMFLAGS F>
       
   622 class ArrayAllocator : StackObj {
       
   623   char* _addr;
       
   624   bool _use_malloc;
       
   625   size_t _size;
       
   626  public:
       
   627   ArrayAllocator() : _addr(NULL), _use_malloc(false), _size(0) { }
       
   628   ~ArrayAllocator() { free(); }
       
   629   E* allocate(size_t length);
       
   630   void free();
       
   631 };
       
   632 
   614 #endif // SHARE_VM_MEMORY_ALLOCATION_HPP
   633 #endif // SHARE_VM_MEMORY_ALLOCATION_HPP