 Chromium Code Reviews
 Chromium Code Reviews Issue 1306183003:
  Re-land "Concurrently unmap free pages."  (Closed) 
  Base URL: https://chromium.googlesource.com/v8/v8.git@master
    
  
    Issue 1306183003:
  Re-land "Concurrently unmap free pages."  (Closed) 
  Base URL: https://chromium.googlesource.com/v8/v8.git@master| Index: src/heap/spaces.h | 
| diff --git a/src/heap/spaces.h b/src/heap/spaces.h | 
| index c00a84fb9b8a55c5da92ddd823b98918aea3097a..e9a208502f89c3881ced3d9ad8fb216f0ad1f7df 100644 | 
| --- a/src/heap/spaces.h | 
| +++ b/src/heap/spaces.h | 
| @@ -980,10 +980,15 @@ class CodeRange { | 
| size_t size; | 
| }; | 
| + // All access to free_list_ require to take the free_list_mutex_. GC threads | 
| + // may access the free_list_ concurrently to the main thread. | 
| + base::Mutex free_list_mutex_; | 
| + | 
| // Freed blocks of memory are added to the free list. When the allocation | 
| // list is exhausted, the free list is sorted and merged to make the new | 
| // allocation list. | 
| List<FreeBlock> free_list_; | 
| + | 
| // Memory is allocated from the free blocks on the allocation list. | 
| // The block at current_allocation_block_index_ is the current block. | 
| List<FreeBlock> allocation_list_; | 
| @@ -1079,6 +1084,15 @@ class MemoryAllocator { | 
| LargePage* AllocateLargePage(intptr_t object_size, Space* owner, | 
| Executability executable); | 
| + // PreFree logically frees the object, i.e., it takes care of the size | 
| + // bookkeeping and calls the allocation callback. | 
| 
Michael Lippautz
2015/08/24 13:43:12
Can we extend this comment to clarify that this co
 | 
| + void PreFreeMemory(MemoryChunk* chunk); | 
| + | 
| + // FreeMemory can be called concurrently when PreFree was executed before. | 
| + void PerformFreeMemory(MemoryChunk* chunk); | 
| + | 
| + // Free is a wrapper method, which calls PreFree and PerformFreeMemory | 
| + // together. | 
| void Free(MemoryChunk* chunk); | 
| // Returns the maximum available bytes of heaps. | 
| @@ -1128,6 +1142,8 @@ class MemoryAllocator { | 
| bool CommitMemory(Address addr, size_t size, Executability executable); | 
| + void FreeNewSpaceMemory(Address addr, base::VirtualMemory* reservation, | 
| + Executability executable); | 
| void FreeMemory(base::VirtualMemory* reservation, Executability executable); | 
| void FreeMemory(Address addr, size_t size, Executability executable); |