| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CallbackStack_h | 5 #ifndef CallbackStack_h |
| 6 #define CallbackStack_h | 6 #define CallbackStack_h |
| 7 | 7 |
| 8 #include "platform/heap/BlinkGC.h" | 8 #include "platform/heap/BlinkGC.h" |
| 9 #include "wtf/Allocator.h" | 9 #include "wtf/Allocator.h" |
| 10 #include "wtf/Assertions.h" | 10 #include "wtf/Assertions.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 private: | 60 private: |
| 61 class Block { | 61 class Block { |
| 62 USING_FAST_MALLOC(Block); | 62 USING_FAST_MALLOC(Block); |
| 63 public: | 63 public: |
| 64 Block(Block* next, size_t blockSize); | 64 Block(Block* next, size_t blockSize); |
| 65 ~Block(); | 65 ~Block(); |
| 66 | 66 |
| 67 #if ENABLE(ASSERT) | 67 #if ENABLE(ASSERT) |
| 68 void clear(); | 68 void clear(); |
| 69 #endif | 69 #endif |
| 70 void reset(); |
| 70 void decommit(); | 71 void decommit(); |
| 71 | 72 |
| 72 Block* next() const { return m_next; } | 73 Block* next() const { return m_next; } |
| 73 void setNext(Block* next) { m_next = next; } | 74 void setNext(Block* next) { m_next = next; } |
| 74 | 75 |
| 75 bool isEmptyBlock() const | 76 bool isEmptyBlock() const |
| 76 { | 77 { |
| 77 return m_current == &(m_buffer[0]); | 78 return m_current == &(m_buffer[0]); |
| 78 } | 79 } |
| 79 | 80 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 Item* item = m_first->pop(); | 132 Item* item = m_first->pop(); |
| 132 if (LIKELY(!!item)) | 133 if (LIKELY(!!item)) |
| 133 return item; | 134 return item; |
| 134 | 135 |
| 135 return popSlow(); | 136 return popSlow(); |
| 136 } | 137 } |
| 137 | 138 |
| 138 } // namespace blink | 139 } // namespace blink |
| 139 | 140 |
| 140 #endif // CallbackStack_h | 141 #endif // CallbackStack_h |
| OLD | NEW |