| 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_SPACES_H_ | 5 #ifndef V8_SPACES_H_ |
| 6 #define V8_SPACES_H_ | 6 #define V8_SPACES_H_ |
| 7 | 7 |
| 8 #include "allocation.h" | 8 #include "allocation.h" |
| 9 #include "hashmap.h" | 9 #include "hashmap.h" |
| 10 #include "list.h" | 10 #include "list.h" |
| (...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 978 // allocation list. | 978 // allocation list. |
| 979 List<FreeBlock> free_list_; | 979 List<FreeBlock> free_list_; |
| 980 // Memory is allocated from the free blocks on the allocation list. | 980 // Memory is allocated from the free blocks on the allocation list. |
| 981 // The block at current_allocation_block_index_ is the current block. | 981 // The block at current_allocation_block_index_ is the current block. |
| 982 List<FreeBlock> allocation_list_; | 982 List<FreeBlock> allocation_list_; |
| 983 int current_allocation_block_index_; | 983 int current_allocation_block_index_; |
| 984 | 984 |
| 985 // Finds a block on the allocation list that contains at least the | 985 // Finds a block on the allocation list that contains at least the |
| 986 // requested amount of memory. If none is found, sorts and merges | 986 // requested amount of memory. If none is found, sorts and merges |
| 987 // the existing free memory blocks, and searches again. | 987 // the existing free memory blocks, and searches again. |
| 988 // If none can be found, terminates V8 with FatalProcessOutOfMemory. | 988 // If none can be found, returns false. |
| 989 void GetNextAllocationBlock(size_t requested); | 989 bool GetNextAllocationBlock(size_t requested); |
| 990 // Compares the start addresses of two free blocks. | 990 // Compares the start addresses of two free blocks. |
| 991 static int CompareFreeBlockAddress(const FreeBlock* left, | 991 static int CompareFreeBlockAddress(const FreeBlock* left, |
| 992 const FreeBlock* right); | 992 const FreeBlock* right); |
| 993 | 993 |
| 994 DISALLOW_COPY_AND_ASSIGN(CodeRange); | 994 DISALLOW_COPY_AND_ASSIGN(CodeRange); |
| 995 }; | 995 }; |
| 996 | 996 |
| 997 | 997 |
| 998 class SkipList { | 998 class SkipList { |
| 999 public: | 999 public: |
| (...skipping 1996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2996 } | 2996 } |
| 2997 // Must be small, since an iteration is used for lookup. | 2997 // Must be small, since an iteration is used for lookup. |
| 2998 static const int kMaxComments = 64; | 2998 static const int kMaxComments = 64; |
| 2999 }; | 2999 }; |
| 3000 #endif | 3000 #endif |
| 3001 | 3001 |
| 3002 | 3002 |
| 3003 } } // namespace v8::internal | 3003 } } // namespace v8::internal |
| 3004 | 3004 |
| 3005 #endif // V8_SPACES_H_ | 3005 #endif // V8_SPACES_H_ |
| OLD | NEW |