| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_HEAP_SPACES_H_ | 5 #ifndef V8_HEAP_SPACES_H_ |
| 6 #define V8_HEAP_SPACES_H_ | 6 #define V8_HEAP_SPACES_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/atomic-utils.h" | 9 #include "src/atomic-utils.h" |
| 10 #include "src/base/atomicops.h" | 10 #include "src/base/atomicops.h" |
| (...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 897 add_available_in_large_free_list(bytes); | 897 add_available_in_large_free_list(bytes); |
| 898 break; | 898 break; |
| 899 case kHuge: | 899 case kHuge: |
| 900 add_available_in_huge_free_list(bytes); | 900 add_available_in_huge_free_list(bytes); |
| 901 break; | 901 break; |
| 902 default: | 902 default: |
| 903 UNREACHABLE(); | 903 UNREACHABLE(); |
| 904 } | 904 } |
| 905 } | 905 } |
| 906 | 906 |
| 907 intptr_t available_in_free_list(FreeListCategoryType type) { |
| 908 switch (type) { |
| 909 case kSmall: |
| 910 return available_in_small_free_list(); |
| 911 case kMedium: |
| 912 return available_in_medium_free_list(); |
| 913 case kLarge: |
| 914 return available_in_large_free_list(); |
| 915 case kHuge: |
| 916 return available_in_huge_free_list(); |
| 917 default: |
| 918 UNREACHABLE(); |
| 919 } |
| 920 UNREACHABLE(); |
| 921 return 0; |
| 922 } |
| 923 |
| 907 #ifdef DEBUG | 924 #ifdef DEBUG |
| 908 void Print(); | 925 void Print(); |
| 909 #endif // DEBUG | 926 #endif // DEBUG |
| 910 | 927 |
| 911 friend class MemoryAllocator; | 928 friend class MemoryAllocator; |
| 912 }; | 929 }; |
| 913 | 930 |
| 914 | 931 |
| 915 class LargePage : public MemoryChunk { | 932 class LargePage : public MemoryChunk { |
| 916 public: | 933 public: |
| (...skipping 2095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3012 count = 0; | 3029 count = 0; |
| 3013 } | 3030 } |
| 3014 // Must be small, since an iteration is used for lookup. | 3031 // Must be small, since an iteration is used for lookup. |
| 3015 static const int kMaxComments = 64; | 3032 static const int kMaxComments = 64; |
| 3016 }; | 3033 }; |
| 3017 #endif | 3034 #endif |
| 3018 } // namespace internal | 3035 } // namespace internal |
| 3019 } // namespace v8 | 3036 } // namespace v8 |
| 3020 | 3037 |
| 3021 #endif // V8_HEAP_SPACES_H_ | 3038 #endif // V8_HEAP_SPACES_H_ |
| OLD | NEW |