Chromium Code Reviews| Index: src/heap/spaces.h |
| diff --git a/src/heap/spaces.h b/src/heap/spaces.h |
| index 46bfd3d71960801e88ff83451417608e4db80bb3..3dc38784206cffb1b90add3bb5946c1bd5f657db 100644 |
| --- a/src/heap/spaces.h |
| +++ b/src/heap/spaces.h |
| @@ -1200,7 +1200,14 @@ class SkipList { |
| int start_region = RegionNumber(addr); |
| int end_region = RegionNumber(addr + size - kPointerSize); |
| for (int idx = start_region; idx <= end_region; idx++) { |
| - if (starts_[idx] > addr) starts_[idx] = addr; |
| + if (starts_[idx] > addr) { |
| + starts_[idx] = addr; |
| + } else { |
| + // In the first region, there may already be an object closer to the |
| + // start of the region. Do not change the start in that case. If this |
| + // is not the first region, you probably added overlapping objects. |
| + DCHECK_EQ(start_region, idx); |
| + } |
| } |
| } |
| @@ -2038,10 +2045,12 @@ class PagedSpace : public Space { |
| return allocation_info_.limit_address(); |
| } |
| + enum UpdateSkipList { UPDATE_SKIP_LIST, IGNORE_SKIP_LIST }; |
| + |
| // Allocate the requested number of bytes in the space if possible, return a |
| // failure object if not. |
|
Hannes Payer (out of office)
2016/03/18 12:54:09
Add a warning there that if you pass in ignore_ski
|
| MUST_USE_RESULT inline AllocationResult AllocateRawUnaligned( |
| - int size_in_bytes); |
| + int size_in_bytes, UpdateSkipList update_skip_list = UPDATE_SKIP_LIST); |
| MUST_USE_RESULT inline AllocationResult AllocateRawUnalignedSynchronized( |
| int size_in_bytes); |