Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(626)

Side by Side Diff: third_party/WebKit/Source/platform/heap/Heap.h

Issue 1754313002: Simplify the shutdown sequence of Oilpan's heap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/heap/Heap.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 static_assert(sizeof(T), "T must be fully defined"); 101 static_assert(sizeof(T), "T must be fully defined");
102 return object->isHeapObjectAlive(); 102 return object->isHeapObjectAlive();
103 } 103 }
104 }; 104 };
105 105
106 class PLATFORM_EXPORT Heap { 106 class PLATFORM_EXPORT Heap {
107 STATIC_ONLY(Heap); 107 STATIC_ONLY(Heap);
108 public: 108 public:
109 static void init(); 109 static void init();
110 static void shutdown(); 110 static void shutdown();
111 static void doShutdown();
112 111
113 static CrossThreadPersistentRegion& crossThreadPersistentRegion(); 112 static CrossThreadPersistentRegion& crossThreadPersistentRegion();
114 113
115 #if ENABLE(ASSERT) 114 #if ENABLE(ASSERT)
116 static BasePage* findPageFromAddress(Address); 115 static BasePage* findPageFromAddress(Address);
117 static BasePage* findPageFromAddress(const void* pointer) { return findPageF romAddress(reinterpret_cast<Address>(const_cast<void*>(pointer))); } 116 static BasePage* findPageFromAddress(const void* pointer) { return findPageF romAddress(reinterpret_cast<Address>(const_cast<void*>(pointer))); }
118 #endif 117 #endif
119 118
120 template<typename T> 119 template<typename T>
121 static inline bool isHeapObjectAlive(T* object) 120 static inline bool isHeapObjectAlive(T* object)
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* object) 531 void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* object)
533 { 532 {
534 T** cell = reinterpret_cast<T**>(object); 533 T** cell = reinterpret_cast<T**>(object);
535 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell)) 534 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell))
536 *cell = nullptr; 535 *cell = nullptr;
537 } 536 }
538 537
539 } // namespace blink 538 } // namespace blink
540 539
541 #endif // Heap_h 540 #endif // Heap_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/heap/Heap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698