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 reserv ed. |
3 * Copyright (C) 2011, Benjamin Poulain <ikipou@gmail.com> | 3 * Copyright (C) 2011, Benjamin Poulain <ikipou@gmail.com> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
14 * | 14 * |
15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
19 * | 19 * |
20 */ | 20 */ |
21 | 21 |
22 #ifndef WTF_LinkedHashSet_h | 22 #ifndef WTF_LinkedHashSet_h |
23 #define WTF_LinkedHashSet_h | 23 #define WTF_LinkedHashSet_h |
24 | 24 |
25 #include "platform/heap/AddressSanitizer.h" | |
sof
2015/05/19 13:36:44
a layering/dependency violation per se.
| |
25 #include "wtf/DefaultAllocator.h" | 26 #include "wtf/DefaultAllocator.h" |
26 #include "wtf/HashSet.h" | 27 #include "wtf/HashSet.h" |
27 #include "wtf/OwnPtr.h" | 28 #include "wtf/OwnPtr.h" |
28 #include "wtf/PassOwnPtr.h" | 29 #include "wtf/PassOwnPtr.h" |
29 | 30 |
30 namespace WTF { | 31 namespace WTF { |
31 | 32 |
32 // LinkedHashSet: Just like HashSet, this class provides a Set | 33 // LinkedHashSet: Just like HashSet, this class provides a Set |
33 // interface - a collection of unique objects with O(1) insertion, | 34 // interface - a collection of unique objects with O(1) insertion, |
34 // removal and test for containership. However, it also has an | 35 // removal and test for containership. However, it also has an |
(...skipping 11 matching lines...) Expand all Loading... | |
46 template<typename LinkedHashSet> class LinkedHashSetConstReverseIterator; | 47 template<typename LinkedHashSet> class LinkedHashSetConstReverseIterator; |
47 | 48 |
48 template<typename Value, typename HashFunctions, typename Allocator> struct Link edHashSetTranslator; | 49 template<typename Value, typename HashFunctions, typename Allocator> struct Link edHashSetTranslator; |
49 template<typename Value, typename Allocator> struct LinkedHashSetExtractor; | 50 template<typename Value, typename Allocator> struct LinkedHashSetExtractor; |
50 template<typename Value, typename ValueTraits, typename Allocator> struct Linked HashSetTraits; | 51 template<typename Value, typename ValueTraits, typename Allocator> struct Linked HashSetTraits; |
51 | 52 |
52 class LinkedHashSetNodeBase { | 53 class LinkedHashSetNodeBase { |
53 public: | 54 public: |
54 LinkedHashSetNodeBase() : m_prev(this), m_next(this) { } | 55 LinkedHashSetNodeBase() : m_prev(this), m_next(this) { } |
55 | 56 |
57 NO_LAZY_SWEEP_SANITIZE_ADDRESS | |
56 void unlink() | 58 void unlink() |
57 { | 59 { |
58 if (!m_next) | 60 if (!m_next) |
59 return; | 61 return; |
60 ASSERT(m_prev); | 62 ASSERT(m_prev); |
61 ASSERT(m_next->m_prev == this); | 63 ASSERT(m_next->m_prev == this); |
62 ASSERT(m_prev->m_next == this); | 64 ASSERT(m_prev->m_next == this); |
63 m_next->m_prev = m_prev; | 65 m_next->m_prev = m_prev; |
64 m_prev->m_next = m_next; | 66 m_prev->m_next = m_next; |
65 } | 67 } |
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
736 struct NeedsTracing<LinkedHashSet<T, U, V>> { | 738 struct NeedsTracing<LinkedHashSet<T, U, V>> { |
737 static const bool value = false; | 739 static const bool value = false; |
738 }; | 740 }; |
739 #endif | 741 #endif |
740 | 742 |
741 } | 743 } |
742 | 744 |
743 using WTF::LinkedHashSet; | 745 using WTF::LinkedHashSet; |
744 | 746 |
745 #endif /* WTF_LinkedHashSet_h */ | 747 #endif /* WTF_LinkedHashSet_h */ |
OLD | NEW |