OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 RELEASE_ASSERT(res); | 270 RELEASE_ASSERT(res); |
271 return storage; | 271 return storage; |
272 #endif | 272 #endif |
273 } | 273 } |
274 | 274 |
275 private: | 275 private: |
276 PageMemory(const MemoryRegion& reserved, const MemoryRegion& writable) | 276 PageMemory(const MemoryRegion& reserved, const MemoryRegion& writable) |
277 : m_reserved(reserved) | 277 : m_reserved(reserved) |
278 , m_writable(writable) | 278 , m_writable(writable) |
279 { | 279 { |
280 // Leak Sanitizer runs before the shutdown sequence runs, and thus PageM
emory objects | 280 // This annotation is for letting the LeakSanitizer ignore PageMemory ob
jects. |
281 // are reported as leaking. So we annotate to let the Leak Sanitizer ign
ore PageMemory objects. | 281 // |
| 282 // - The LeakSanitizer runs before the shutdown sequence and reports unr
eachable memory blocks. |
| 283 // - The LeakSanitizer only recognizes memory blocks allocated through m
alloc/new, |
| 284 // and we need special handling for mapped regions. |
| 285 // - The PageMemory object is only referenced by a HeapPage<Header> obje
ct, which is |
| 286 // located inside the mapped region, which is not released until the s
hutdown sequence. |
| 287 // |
| 288 // Given the above, we need to explicitly annotate that the LeakSanitize
r should ignore |
| 289 // PageMemory objects. |
282 WTF_ANNOTATE_LEAKING_OBJECT_PTR(this); | 290 WTF_ANNOTATE_LEAKING_OBJECT_PTR(this); |
283 | 291 |
284 ASSERT(reserved.contains(writable)); | 292 ASSERT(reserved.contains(writable)); |
285 } | 293 } |
286 | 294 |
287 MemoryRegion m_reserved; | 295 MemoryRegion m_reserved; |
288 MemoryRegion m_writable; | 296 MemoryRegion m_writable; |
289 }; | 297 }; |
290 | 298 |
291 class GCScope { | 299 class GCScope { |
(...skipping 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1676 template class HeapPage<FinalizedHeapObjectHeader>; | 1684 template class HeapPage<FinalizedHeapObjectHeader>; |
1677 template class HeapPage<HeapObjectHeader>; | 1685 template class HeapPage<HeapObjectHeader>; |
1678 template class ThreadHeap<FinalizedHeapObjectHeader>; | 1686 template class ThreadHeap<FinalizedHeapObjectHeader>; |
1679 template class ThreadHeap<HeapObjectHeader>; | 1687 template class ThreadHeap<HeapObjectHeader>; |
1680 | 1688 |
1681 Visitor* Heap::s_markingVisitor; | 1689 Visitor* Heap::s_markingVisitor; |
1682 CallbackStack* Heap::s_markingStack; | 1690 CallbackStack* Heap::s_markingStack; |
1683 CallbackStack* Heap::s_weakCallbackStack; | 1691 CallbackStack* Heap::s_weakCallbackStack; |
1684 bool Heap::s_shutdownCalled = false; | 1692 bool Heap::s_shutdownCalled = false; |
1685 } | 1693 } |
OLD | NEW |