Chromium Code Reviews| Index: Source/heap/Heap.h |
| diff --git a/Source/heap/Heap.h b/Source/heap/Heap.h |
| index f7f5b6b452b4cda0cf65920f46bdc91017603af0..0a639259c97e5f1c0e4b3dc1b528da231426db6a 100644 |
| --- a/Source/heap/Heap.h |
| +++ b/Source/heap/Heap.h |
| @@ -1006,6 +1006,11 @@ public: |
| return m_refCount == 1; |
| } |
| + int refCount() |
| + { |
| + return m_refCount; |
| + } |
| + |
| protected: |
| ~RefCountedGarbageCollected() { } |
| @@ -1017,7 +1022,6 @@ private: |
| template<typename T> |
| T* adoptRefCountedGarbageCollected(T* ptr) |
| { |
| - ASSERT(ptr->hasOneRef()); |
|
Mads Ager (chromium)
2014/03/20 08:30:00
All ref counted object should start with ref count
keishi
2014/03/27 07:39:37
I was hitting this at one point but the issue seem
|
| ptr->deref(); |
| WTF::adopted(ptr); |
| return ptr; |
| @@ -1141,6 +1145,7 @@ template<typename T> |
| Address Heap::allocate(size_t size) |
| { |
| ThreadState* state = ThreadStateFor<ThreadingTrait<T>::Affinity>::state(); |
| + ASSERT(state); |
|
Mads Ager (chromium)
2014/03/20 08:30:00
I would remove this assert. The assert below will
keishi
2014/03/27 07:39:37
Removed.
|
| ASSERT(state->isAllocationAllowed()); |
| BaseHeap* heap = state->heap(HeapTrait<T>::index); |
| Address addr = |