Chromium Code Reviews| Index: src/heap/spaces.h |
| diff --git a/src/heap/spaces.h b/src/heap/spaces.h |
| index ef294b243948b3cd4bbdc5101385baf295cb8a73..f3345f185cc1e68fb70cde85f0b4df5f08da0cad 100644 |
| --- a/src/heap/spaces.h |
| +++ b/src/heap/spaces.h |
| @@ -900,6 +900,9 @@ class CodeRange { |
| bool UncommitRawMemory(Address start, size_t length); |
| void FreeRawMemory(Address buf, size_t length); |
| + void ReserveEmergencyBlock(); |
| + void ReleaseEmergencyBlock(); |
| + |
| private: |
| Isolate* isolate_; |
| @@ -908,6 +911,7 @@ class CodeRange { |
| // Plain old data class, just a struct plus a constructor. |
| class FreeBlock { |
| public: |
| + FreeBlock() : start(0), size(0) {} |
| FreeBlock(Address start_arg, size_t size_arg) |
| : start(start_arg), size(size_arg) { |
| DCHECK(IsAddressAligned(start, MemoryChunk::kAlignment)); |
| @@ -932,6 +936,8 @@ class CodeRange { |
| List<FreeBlock> allocation_list_; |
| int current_allocation_block_index_; |
| + FreeBlock emergency_block_; |
|
Hannes Payer (out of office)
2014/11/20 08:00:37
Please add a comment that describes the concept of
ulan
2014/11/20 13:49:30
Done.
|
| + |
| // Finds a block on the allocation list that contains at least the |
| // requested amount of memory. If none is found, sorts and merges |
| // the existing free memory blocks, and searches again. |
| @@ -940,6 +946,8 @@ class CodeRange { |
| // Compares the start addresses of two free blocks. |
| static int CompareFreeBlockAddress(const FreeBlock* left, |
| const FreeBlock* right); |
| + bool ReserveBlock(const size_t requested_size, FreeBlock* block); |
| + void ReleaseBlock(const FreeBlock* block); |
| DISALLOW_COPY_AND_ASSIGN(CodeRange); |
| }; |