Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/PersistentNode.h" | 5 #include "platform/heap/PersistentNode.h" |
| 6 | 6 |
| 7 #include "platform/heap/Handle.h" | 7 #include "platform/heap/Handle.h" |
| 8 | 8 |
| 9 namespace blink { | 9 namespace blink { |
| 10 | 10 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 80 m_freeListHead = nullptr; | 80 m_freeListHead = nullptr; |
| 81 int persistentCount = 0; | 81 int persistentCount = 0; |
| 82 PersistentNodeSlots** prevNext = &m_slots; | 82 PersistentNodeSlots** prevNext = &m_slots; |
| 83 PersistentNodeSlots* slots = m_slots; | 83 PersistentNodeSlots* slots = m_slots; |
| 84 while (slots) { | 84 while (slots) { |
| 85 PersistentNode* freeListNext = nullptr; | 85 PersistentNode* freeListNext = nullptr; |
| 86 PersistentNode* freeListLast = nullptr; | 86 PersistentNode* freeListLast = nullptr; |
| 87 int freeCount = 0; | 87 int freeCount = 0; |
| 88 for (int i = 0; i < PersistentNodeSlots::slotCount; ++i) { | 88 for (int i = 0; i < PersistentNodeSlots::slotCount; ++i) { |
| 89 PersistentNode* node = &slots->m_slot[i]; | 89 PersistentNode* node = &slots->m_slot[i]; |
| 90 ASAN_UNPOISON_MEMORY_REGION(node->self(), | |
| 91 sizeof(CrossThreadPersistent<void*>)); | |
|
haraken
2016/10/17 03:55:22
Would you help me understand who poisons the memor
| |
| 90 if (node->isUnused()) { | 92 if (node->isUnused()) { |
| 91 if (!freeListNext) | 93 if (!freeListNext) |
| 92 freeListLast = node; | 94 freeListLast = node; |
| 93 node->setFreeListNext(freeListNext); | 95 node->setFreeListNext(freeListNext); |
| 94 freeListNext = node; | 96 freeListNext = node; |
| 95 ++freeCount; | 97 ++freeCount; |
| 96 } else { | 98 } else { |
| 97 ++persistentCount; | 99 ++persistentCount; |
| 98 if (!shouldTrace(visitor, node)) | 100 if (!shouldTrace(visitor, node)) |
| 99 continue; | 101 continue; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 167 if (page->arena()->getThreadState() == threadState) { | 169 if (page->arena()->getThreadState() == threadState) { |
| 168 persistent->clear(); | 170 persistent->clear(); |
| 169 ASSERT(slots->m_slot[i].isUnused()); | 171 ASSERT(slots->m_slot[i].isUnused()); |
| 170 } | 172 } |
| 171 } | 173 } |
| 172 slots = slots->m_next; | 174 slots = slots->m_next; |
| 173 } | 175 } |
| 174 } | 176 } |
| 175 | 177 |
| 176 } // namespace blink | 178 } // namespace blink |
| OLD | NEW |