721 static E* allocate_malloc(size_t length);
722 static E* allocate_mmap(size_t length);
723
724 static void free_malloc(E* addr, size_t length);
725 static void free_mmap(E* addr, size_t length);
726
727 public:
728 static E* allocate(size_t length);
729 static E* reallocate(E* old_addr, size_t old_length, size_t new_length);
730 static void free(E* addr, size_t length);
731 };
732
733 // Uses mmaped memory for all allocations. All allocations are initially
734 // zero-filled. No pre-touching.
735 template <class E, MEMFLAGS F>
736 class MmapArrayAllocator : public AllStatic {
737 private:
738 static size_t size_for(size_t length);
739
740 public:
741 static E* allocate(size_t length);
742 static void free(E* addr, size_t length);
743 };
744
745 // Uses malloc:ed memory for all allocations.
746 template <class E, MEMFLAGS F>
747 class MallocArrayAllocator : public AllStatic {
748 public:
749 static size_t size_for(size_t length);
750
751 static E* allocate(size_t length);
752 static void free(E* addr, size_t length);
753 };
754
755 #endif // SHARE_VM_MEMORY_ALLOCATION_HPP
|
721 static E* allocate_malloc(size_t length);
722 static E* allocate_mmap(size_t length);
723
724 static void free_malloc(E* addr, size_t length);
725 static void free_mmap(E* addr, size_t length);
726
727 public:
728 static E* allocate(size_t length);
729 static E* reallocate(E* old_addr, size_t old_length, size_t new_length);
730 static void free(E* addr, size_t length);
731 };
732
733 // Uses mmaped memory for all allocations. All allocations are initially
734 // zero-filled. No pre-touching.
735 template <class E, MEMFLAGS F>
736 class MmapArrayAllocator : public AllStatic {
737 private:
738 static size_t size_for(size_t length);
739
740 public:
741 static E* allocate_or_null(size_t length);
742 static E* allocate(size_t length);
743 static void free(E* addr, size_t length);
744 };
745
746 // Uses malloc:ed memory for all allocations.
747 template <class E, MEMFLAGS F>
748 class MallocArrayAllocator : public AllStatic {
749 public:
750 static size_t size_for(size_t length);
751
752 static E* allocate(size_t length);
753 static void free(E* addr, size_t length);
754 };
755
756 #endif // SHARE_VM_MEMORY_ALLOCATION_HPP
|