Mercurial > hg > truffle
comparison src/share/vm/memory/allocation.hpp @ 9073:83f27710f5f7
7197666: java -d64 -version core dumps in a box with lots of memory
Summary: Allow task queues to be mmapped instead of malloced on Solaris
Reviewed-by: coleenp, jmasa, johnc, tschatzl
author | brutisso |
---|---|
date | Mon, 08 Apr 2013 07:49:28 +0200 |
parents | 4102b59539ce |
children | 89e4d67fdd2a f36e073d56a4 6f817ce50129 f75faf51e8c4 |
comparison
equal
deleted
inserted
replaced
9072:8617e38bb4cb | 9073:83f27710f5f7 |
---|---|
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 |