1b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers/* 2b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers * Copyright (C) 2014 The Android Open Source Project 3b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers * 4b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers * Licensed under the Apache License, Version 2.0 (the "License"); 5b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers * you may not use this file except in compliance with the License. 6b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers * You may obtain a copy of the License at 7b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers * 8b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers * http://www.apache.org/licenses/LICENSE-2.0 9b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers * 10b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers * Unless required by applicable law or agreed to in writing, software 11b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers * distributed under the License is distributed on an "AS IS" BASIS, 12b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers * See the License for the specific language governing permissions and 14b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers * limitations under the License. 15b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers */ 16b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers 17b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers#ifndef ART_RUNTIME_GC_ALLOCATOR_TYPE_H_ 18b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers#define ART_RUNTIME_GC_ALLOCATOR_TYPE_H_ 19b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers 203cf225386e8129dcbe32b289279ecb87ec255318Mathieu Chartier#include <iosfwd> 216a3c1fcb4ba42ad4d5d142c17a3712a6ddd3866fIan Rogers 22b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogersnamespace art { 23b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogersnamespace gc { 24b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers 25b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers// Different types of allocators. 26b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogersenum AllocatorType { 27b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers kAllocatorTypeBumpPointer, // Use BumpPointer allocator, has entrypoints. 28b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers kAllocatorTypeTLAB, // Use TLAB allocator, has entrypoints. 29b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers kAllocatorTypeRosAlloc, // Use RosAlloc allocator, has entrypoints. 30b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers kAllocatorTypeDlMalloc, // Use dlmalloc allocator, has entrypoints. 31b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers kAllocatorTypeNonMoving, // Special allocator for non moving objects, doesn't have entrypoints. 32b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers kAllocatorTypeLOS, // Large object space, also doesn't have entrypoints. 332cd334ae2d4287216523882f0d298cf3901b7ab1Hiroshi Yamauchi kAllocatorTypeRegion, 342cd334ae2d4287216523882f0d298cf3901b7ab1Hiroshi Yamauchi kAllocatorTypeRegionTLAB, 35b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers}; 366a3c1fcb4ba42ad4d5d142c17a3712a6ddd3866fIan Rogersstd::ostream& operator<<(std::ostream& os, const AllocatorType& rhs); 37b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers 386bc7774426cc0b6bbab5566fa62b3c509455e583Mathieu Chartierinline constexpr bool IsTLABAllocator(AllocatorType allocator) { 396bc7774426cc0b6bbab5566fa62b3c509455e583Mathieu Chartier return allocator == kAllocatorTypeTLAB || allocator == kAllocatorTypeRegionTLAB; 406bc7774426cc0b6bbab5566fa62b3c509455e583Mathieu Chartier} 416bc7774426cc0b6bbab5566fa62b3c509455e583Mathieu Chartier 42b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers} // namespace gc 43b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers} // namespace art 44b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers 45b0fa5dc7769c1e054032f39de0a3f6d6dd06f8cfIan Rogers#endif // ART_RUNTIME_GC_ALLOCATOR_TYPE_H_ 46