Commit 6f470786 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

wtf: Remove Visitor type from PartitionAllocator

Change-Id: I6b9cbd66d7015cdf239db8c6906ee18595c2b4b4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1901072
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712986}
parent aa6e13aa
...@@ -18,13 +18,8 @@ ...@@ -18,13 +18,8 @@
namespace WTF { namespace WTF {
class PartitionAllocatorDummyVisitor {
DISALLOW_NEW();
};
class WTF_EXPORT PartitionAllocator { class WTF_EXPORT PartitionAllocator {
public: public:
typedef PartitionAllocatorDummyVisitor Visitor;
static constexpr bool kIsGarbageCollected = false; static constexpr bool kIsGarbageCollected = false;
template <typename T> template <typename T>
......
...@@ -381,8 +381,8 @@ struct ListHashSetAllocator : public PartitionAllocator { ...@@ -381,8 +381,8 @@ struct ListHashSetAllocator : public PartitionAllocator {
bool InPool(Node* node) { return node >= Pool() && node < PastPool(); } bool InPool(Node* node) { return node >= Pool() && node < PastPool(); }
static void TraceValue(typename PartitionAllocator::Visitor* visitor, template <typename VisitorDispatcher>
Node* node) {} static void TraceValue(VisitorDispatcher, Node*) {}
private: private:
Node* Pool() { return reinterpret_cast_ptr<Node*>(pool_); } Node* Pool() { return reinterpret_cast_ptr<Node*>(pool_); }
...@@ -451,8 +451,8 @@ class ListHashSetNode : public ListHashSetNodeBase<ValueArg> { ...@@ -451,8 +451,8 @@ class ListHashSetNode : public ListHashSetNodeBase<ValueArg> {
allocator->Deallocate(this); allocator->Deallocate(this);
} }
template <typename VisitorDispatcher> template <typename VisitorDispatcher, typename A = NodeAllocator>
void Trace(VisitorDispatcher visitor) { std::enable_if_t<A::kIsGarbageCollected> Trace(VisitorDispatcher visitor) {
// The conservative stack scan can find nodes that have been removed // The conservative stack scan can find nodes that have been removed
// from the set and destructed. We don't need to trace these, and it // from the set and destructed. We don't need to trace these, and it
// would be wrong to do so, because the class will not expect the trace // would be wrong to do so, because the class will not expect the trace
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment