| 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 #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/ThreadingPrimitives.h" | 10 #include "wtf/ThreadingPrimitives.h" |
| 10 | 11 |
| 11 namespace blink { | 12 namespace blink { |
| 12 | 13 |
| 13 class BasePage; | 14 class BasePage; |
| 14 class PageMemory; | 15 class PageMemory; |
| 15 | 16 |
| 16 template<typename DataType> | 17 template<typename DataType> |
| 17 class PagePool { | 18 class PagePool { |
| 19 USING_FAST_MALLOC(PagePool); |
| 18 protected: | 20 protected: |
| 19 PagePool() | 21 PagePool() |
| 20 { | 22 { |
| 21 for (int i = 0; i < BlinkGC::NumberOfHeaps; ++i) | 23 for (int i = 0; i < BlinkGC::NumberOfHeaps; ++i) |
| 22 m_pool[i] = nullptr; | 24 m_pool[i] = nullptr; |
| 23 } | 25 } |
| 24 | 26 |
| 25 class PoolEntry { | 27 class PoolEntry { |
| 28 USING_FAST_MALLOC(PoolEntry); |
| 26 public: | 29 public: |
| 27 PoolEntry(DataType* data, PoolEntry* next) | 30 PoolEntry(DataType* data, PoolEntry* next) |
| 28 : data(data) | 31 : data(data) |
| 29 , next(next) | 32 , next(next) |
| 30 { } | 33 { } |
| 31 | 34 |
| 32 DataType* data; | 35 DataType* data; |
| 33 PoolEntry* next; | 36 PoolEntry* next; |
| 34 }; | 37 }; |
| 35 | 38 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // causing ASan errors. asanDisabledMemset must not be used for | 76 // causing ASan errors. asanDisabledMemset must not be used for |
| 74 // non-orphaned pages. | 77 // non-orphaned pages. |
| 75 static void asanDisabledMemset(Address, char, size_t); | 78 static void asanDisabledMemset(Address, char, size_t); |
| 76 private: | 79 private: |
| 77 void clearMemory(PageMemory*); | 80 void clearMemory(PageMemory*); |
| 78 }; | 81 }; |
| 79 | 82 |
| 80 } // namespace blink | 83 } // namespace blink |
| 81 | 84 |
| 82 #endif | 85 #endif |
| OLD | NEW |