OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All rights |
| 3 * reserved. |
3 * Copyright (C) 2011, Benjamin Poulain <ikipou@gmail.com> | 4 * Copyright (C) 2011, Benjamin Poulain <ikipou@gmail.com> |
4 * | 5 * |
5 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
9 * | 10 * |
10 * This library is distributed in the hope that it will be useful, | 11 * This library is distributed in the hope that it will be useful, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 !IsTriviallyDestructible<ValueArg>::value) | 416 !IsTriviallyDestructible<ValueArg>::value) |
416 this->m_prev = unlinkedNodePointer(); | 417 this->m_prev = unlinkedNodePointer(); |
417 } | 418 } |
418 | 419 |
419 bool wasAlreadyDestructed() const { | 420 bool wasAlreadyDestructed() const { |
420 ASSERT(NodeAllocator::isGarbageCollected); | 421 ASSERT(NodeAllocator::isGarbageCollected); |
421 return this->m_prev == unlinkedNodePointer(); | 422 return this->m_prev == unlinkedNodePointer(); |
422 } | 423 } |
423 | 424 |
424 static void finalize(void* pointer) { | 425 static void finalize(void* pointer) { |
425 ASSERT( | 426 // No need to waste time calling finalize if it's not needed. |
426 !IsTriviallyDestructible<ValueArg>:: | 427 ASSERT(!IsTriviallyDestructible<ValueArg>::value); |
427 value); // No need to waste time calling finalize if it's not neede
d. | |
428 ListHashSetNode* self = reinterpret_cast_ptr<ListHashSetNode*>(pointer); | 428 ListHashSetNode* self = reinterpret_cast_ptr<ListHashSetNode*>(pointer); |
429 | 429 |
430 // Check whether this node was already destructed before being unlinked | 430 // Check whether this node was already destructed before being unlinked |
431 // from the collection. | 431 // from the collection. |
432 if (self->wasAlreadyDestructed()) | 432 if (self->wasAlreadyDestructed()) |
433 return; | 433 return; |
434 | 434 |
435 self->m_value.~ValueArg(); | 435 self->m_value.~ValueArg(); |
436 } | 436 } |
437 void finalizeGarbageCollectedObject() { finalize(this); } | 437 void finalizeGarbageCollectedObject() { finalize(this); } |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1101 // through the HashTable. That includes m_head and m_tail so we do not have | 1101 // through the HashTable. That includes m_head and m_tail so we do not have |
1102 // to explicitly trace them here. | 1102 // to explicitly trace them here. |
1103 m_impl.trace(visitor); | 1103 m_impl.trace(visitor); |
1104 } | 1104 } |
1105 | 1105 |
1106 } // namespace WTF | 1106 } // namespace WTF |
1107 | 1107 |
1108 using WTF::ListHashSet; | 1108 using WTF::ListHashSet; |
1109 | 1109 |
1110 #endif // WTF_ListHashSet_h | 1110 #endif // WTF_ListHashSet_h |
OLD | NEW |