128 mtJavaHeap = 0x00, // Java heap 129 mtClass = 0x01, // memory class for Java classes 130 mtThread = 0x02, // memory for thread objects 131 mtThreadStack = 0x03, 132 mtCode = 0x04, // memory for generated code 133 mtGC = 0x05, // memory for GC 134 mtCompiler = 0x06, // memory for compiler 135 mtInternal = 0x07, // memory used by VM, but does not belong to 136 // any of above categories, and not used for 137 // native memory tracking 138 mtOther = 0x08, // memory not used by VM 139 mtSymbol = 0x09, // symbol 140 mtNMT = 0x0A, // memory used by native memory tracking 141 mtClassShared = 0x0B, // class data sharing 142 mtChunk = 0x0C, // chunk that holds content of arenas 143 mtTest = 0x0D, // Test type for verifying NMT 144 mtTracing = 0x0E, // memory used for Tracing 145 mtLogging = 0x0F, // memory for logging 146 mtArguments = 0x10, // memory for argument processing 147 mtModule = 0x11, // memory for module processing 148 mtNone = 0x12, // undefined 149 mt_number_of_types = 0x13 // number of memory types (mtDontTrack 150 // is not included as validate type) 151 }; 152 153 typedef MemoryType MEMFLAGS; 154 155 156 #if INCLUDE_NMT 157 158 extern bool NMT_track_callsite; 159 160 #else 161 162 const bool NMT_track_callsite = false; 163 164 #endif // INCLUDE_NMT 165 166 class NativeCallStack; 167 168 169 template <MEMFLAGS F> class CHeapObj ALLOCATION_SUPER_CLASS_SPEC { 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 | 128 mtJavaHeap = 0x00, // Java heap 129 mtClass = 0x01, // memory class for Java classes 130 mtThread = 0x02, // memory for thread objects 131 mtThreadStack = 0x03, 132 mtCode = 0x04, // memory for generated code 133 mtGC = 0x05, // memory for GC 134 mtCompiler = 0x06, // memory for compiler 135 mtInternal = 0x07, // memory used by VM, but does not belong to 136 // any of above categories, and not used for 137 // native memory tracking 138 mtOther = 0x08, // memory not used by VM 139 mtSymbol = 0x09, // symbol 140 mtNMT = 0x0A, // memory used by native memory tracking 141 mtClassShared = 0x0B, // class data sharing 142 mtChunk = 0x0C, // chunk that holds content of arenas 143 mtTest = 0x0D, // Test type for verifying NMT 144 mtTracing = 0x0E, // memory used for Tracing 145 mtLogging = 0x0F, // memory for logging 146 mtArguments = 0x10, // memory for argument processing 147 mtModule = 0x11, // memory for module processing 148 mtValueTypes = 0x12, // memory for buffered value types 149 mtNone = 0x13, // undefined 150 mt_number_of_types = 0x14 // number of memory types (mtDontTrack 151 // is not included as validate type) 152 }; 153 154 typedef MemoryType MEMFLAGS; 155 156 157 #if INCLUDE_NMT 158 159 extern bool NMT_track_callsite; 160 161 #else 162 163 const bool NMT_track_callsite = false; 164 165 #endif // INCLUDE_NMT 166 167 class NativeCallStack; 168 169 170 template <MEMFLAGS F> class CHeapObj ALLOCATION_SUPER_CLASS_SPEC { 735 // zero-filled. No pre-touching. 736 template <class E, MEMFLAGS F> 737 class MmapArrayAllocator : public AllStatic { 738 private: 739 static size_t size_for(size_t length); 740 741 public: 742 static E* allocate_or_null(size_t length); 743 static E* allocate(size_t length); 744 static void free(E* addr, size_t length); 745 }; 746 747 // Uses malloc:ed memory for all allocations. 748 template <class E, MEMFLAGS F> 749 class MallocArrayAllocator : public AllStatic { 750 public: 751 static size_t size_for(size_t length); 752 753 static E* allocate(size_t length); 754 static void free(E* addr, size_t length); 755 }; 756 757 template <class E, MEMFLAGS F> class CMmapObj ALLOCATION_SUPER_CLASS_SPEC { 758 public: 759 void* operator new(size_t size); 760 void operator delete(void* address, size_t length); 761 }; 762 763 #endif // SHARE_VM_MEMORY_ALLOCATION_HPP |