Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(635)

Side by Side Diff: Source/wtf/LinkedHashSet.h

Issue 1145073002: Move AddressSanitizer.h to wtf/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix non-Oilpan compilation Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/wtf/Atomics.h ('k') | Source/wtf/wtf.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "wtf/AddressSanitizer.h"
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 // TODO(sof): See NO_SANITIZE_ADDRESS comment in platform/heap/AddressSanitizer. h
31 // on the Windows toolchain special case; that comment also covers why we
32 // temporarily need this NO_LAZY_SWEEP_SANITIZE_ADDRESS_WTF annotation.
33 // (macro repeatedly defined here so as to avoid introducing an improper
34 // wtf/ => platform/ dependency.)
35 #if defined(ADDRESS_SANITIZER) && ENABLE(OILPAN) && (!OS(WIN) || COMPILER(CLANG) )
36 #define NO_LAZY_SWEEP_SANITIZE_ADDRESS_WTF __attribute__((no_sanitize_address))
37 #else
38 #define NO_LAZY_SWEEP_SANITIZE_ADDRESS_WTF
39 #endif
40
41 namespace WTF { 31 namespace WTF {
42 32
43 // LinkedHashSet: Just like HashSet, this class provides a Set 33 // LinkedHashSet: Just like HashSet, this class provides a Set
44 // interface - a collection of unique objects with O(1) insertion, 34 // interface - a collection of unique objects with O(1) insertion,
45 // removal and test for containership. However, it also has an 35 // removal and test for containership. However, it also has an
46 // order - iterating it will always give back values in the order 36 // order - iterating it will always give back values in the order
47 // in which they are added. 37 // in which they are added.
48 38
49 // Unlike ListHashSet, but like most WTF collections, iteration is NOT safe 39 // Unlike ListHashSet, but like most WTF collections, iteration is NOT safe
50 // against mutation of the LinkedHashSet. 40 // against mutation of the LinkedHashSet.
51 41
52 template<typename Value, typename HashFunctions, typename HashTraits, typename A llocator> class LinkedHashSet; 42 template<typename Value, typename HashFunctions, typename HashTraits, typename A llocator> class LinkedHashSet;
53 43
54 template<typename LinkedHashSet> class LinkedHashSetIterator; 44 template<typename LinkedHashSet> class LinkedHashSetIterator;
55 template<typename LinkedHashSet> class LinkedHashSetConstIterator; 45 template<typename LinkedHashSet> class LinkedHashSetConstIterator;
56 template<typename LinkedHashSet> class LinkedHashSetReverseIterator; 46 template<typename LinkedHashSet> class LinkedHashSetReverseIterator;
57 template<typename LinkedHashSet> class LinkedHashSetConstReverseIterator; 47 template<typename LinkedHashSet> class LinkedHashSetConstReverseIterator;
58 48
59 template<typename Value, typename HashFunctions, typename Allocator> struct Link edHashSetTranslator; 49 template<typename Value, typename HashFunctions, typename Allocator> struct Link edHashSetTranslator;
60 template<typename Value, typename Allocator> struct LinkedHashSetExtractor; 50 template<typename Value, typename Allocator> struct LinkedHashSetExtractor;
61 template<typename Value, typename ValueTraits, typename Allocator> struct Linked HashSetTraits; 51 template<typename Value, typename ValueTraits, typename Allocator> struct Linked HashSetTraits;
62 52
63 class LinkedHashSetNodeBase { 53 class LinkedHashSetNodeBase {
64 public: 54 public:
65 LinkedHashSetNodeBase() : m_prev(this), m_next(this) { } 55 LinkedHashSetNodeBase() : m_prev(this), m_next(this) { }
66 56
67 NO_LAZY_SWEEP_SANITIZE_ADDRESS_WTF 57 NO_LAZY_SWEEP_SANITIZE_ADDRESS
68 void unlink() 58 void unlink()
69 { 59 {
70 if (!m_next) 60 if (!m_next)
71 return; 61 return;
72 ASSERT(m_prev); 62 ASSERT(m_prev);
73 ASSERT(m_next->m_prev == this); 63 ASSERT(m_next->m_prev == this);
74 ASSERT(m_prev->m_next == this); 64 ASSERT(m_prev->m_next == this);
75 m_next->m_prev = m_prev; 65 m_next->m_prev = m_prev;
76 m_prev->m_next = m_next; 66 m_prev->m_next = m_next;
77 } 67 }
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 struct NeedsTracing<LinkedHashSet<T, U, V>> { 738 struct NeedsTracing<LinkedHashSet<T, U, V>> {
749 static const bool value = false; 739 static const bool value = false;
750 }; 740 };
751 #endif 741 #endif
752 742
753 } 743 }
754 744
755 using WTF::LinkedHashSet; 745 using WTF::LinkedHashSet;
756 746
757 #endif /* WTF_LinkedHashSet_h */ 747 #endif /* WTF_LinkedHashSet_h */
OLDNEW
« no previous file with comments | « Source/wtf/Atomics.h ('k') | Source/wtf/wtf.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698