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

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

Issue 2684633004: Remove orphaned pages from Oilpan (Closed)
Patch Set: temp Created 3 years, 10 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
OLDNEW
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 #ifndef PagePool_h 5 #ifndef PagePool_h
6 #define PagePool_h 6 #define PagePool_h
7 7
8 #include "platform/heap/ThreadState.h" 8 #include "platform/heap/ThreadState.h"
9 #include "wtf/Allocator.h" 9 #include "wtf/Allocator.h"
10 #include "wtf/ThreadingPrimitives.h" 10 #include "wtf/ThreadingPrimitives.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 class BasePage;
15 class PageMemory; 14 class PageMemory;
16 15
17 template <typename DataType> 16 template <typename DataType>
18 class PagePool { 17 class PagePool {
19 USING_FAST_MALLOC(PagePool); 18 USING_FAST_MALLOC(PagePool);
20 19
21 protected: 20 protected:
22 PagePool() { 21 PagePool() {
23 for (int i = 0; i < BlinkGC::NumberOfArenas; ++i) 22 for (int i = 0; i < BlinkGC::NumberOfArenas; ++i)
24 m_pool[i] = nullptr; 23 m_pool[i] = nullptr;
(...skipping 23 matching lines...) Expand all
48 class FreePagePool : public PagePool<PageMemory> { 47 class FreePagePool : public PagePool<PageMemory> {
49 public: 48 public:
50 ~FreePagePool(); 49 ~FreePagePool();
51 void addFreePage(int, PageMemory*); 50 void addFreePage(int, PageMemory*);
52 PageMemory* takeFreePage(int); 51 PageMemory* takeFreePage(int);
53 52
54 private: 53 private:
55 Mutex m_mutex[BlinkGC::NumberOfArenas]; 54 Mutex m_mutex[BlinkGC::NumberOfArenas];
56 }; 55 };
57 56
58 class OrphanedPagePool : public PagePool<BasePage> {
59 public:
60 // The orphaned zap value must be zero in the lowest bits to allow for
61 // using the mark bit when tracing.
62 static const uint8_t orphanedZapValue = 0xdc;
63
64 ~OrphanedPagePool();
65 void addOrphanedPage(int, BasePage*);
66 void decommitOrphanedPages();
67 #if DCHECK_IS_ON()
68 bool contains(void*);
69 #endif
70
71 // For orphaned pages, we need to memset with ASan disabled, because
72 // the orphaned pages can still contain poisoned memory or annotated
73 // container but we want to forcibly clear the orphaned pages without
74 // causing ASan errors. asanDisabledMemset must not be used for
75 // non-orphaned pages.
76 static void asanDisabledMemset(Address, char, size_t);
77
78 private:
79 void clearMemory(PageMemory*);
80 };
81
82 } // namespace blink 57 } // namespace blink
83 58
84 #endif 59 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/HeapPage.cpp ('k') | third_party/WebKit/Source/platform/heap/PagePool.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698