| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium 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 #include "platform/heap/SparseHeapBitmap.h" | 5 #include "platform/heap/SparseHeapBitmap.h" |
| 6 | 6 |
| 7 #include "platform/heap/Heap.h" |
| 7 #include "wtf/PtrUtil.h" | 8 #include "wtf/PtrUtil.h" |
| 8 | 9 |
| 9 namespace blink { | 10 namespace blink { |
| 10 | 11 |
| 11 // Return the subtree/bitmap that covers the | 12 // Return the subtree/bitmap that covers the |
| 12 // [address, address + size) range. Null if there is none. | 13 // [address, address + size) range. Null if there is none. |
| 13 SparseHeapBitmap* SparseHeapBitmap::hasRange(Address address, size_t size) { | 14 SparseHeapBitmap* SparseHeapBitmap::hasRange(Address address, size_t size) { |
| 14 DCHECK(!(reinterpret_cast<uintptr_t>(address) & s_pointerAlignmentMask)); | 15 DCHECK(!(reinterpret_cast<uintptr_t>(address) & s_pointerAlignmentMask)); |
| 15 SparseHeapBitmap* bitmap = this; | 16 SparseHeapBitmap* bitmap = this; |
| 16 while (bitmap) { | 17 while (bitmap) { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 size_t SparseHeapBitmap::intervalCount() const { | 103 size_t SparseHeapBitmap::intervalCount() const { |
| 103 size_t count = 1; | 104 size_t count = 1; |
| 104 if (m_left) | 105 if (m_left) |
| 105 count += m_left->intervalCount(); | 106 count += m_left->intervalCount(); |
| 106 if (m_right) | 107 if (m_right) |
| 107 count += m_right->intervalCount(); | 108 count += m_right->intervalCount(); |
| 108 return count; | 109 return count; |
| 109 } | 110 } |
| 110 | 111 |
| 111 } // namespace blink | 112 } // namespace blink |
| OLD | NEW |