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

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

Issue 106423003: [oilpan] Rename visit to mark. (Closed) Base URL: svn://svn.chromium.org/blink/branches/oilpan
Patch Set: Address comments. Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « Source/wtf/TypeTraits.h ('k') | Source/wtf/VectorTraits.h » ('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 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 } 569 }
570 } 570 }
571 571
572 void finalize() 572 void finalize()
573 { 573 {
574 this->~Vector(); 574 this->~Vector();
575 } 575 }
576 576
577 void clearUnusedSlots(T* from, T* to) 577 void clearUnusedSlots(T* from, T* to)
578 { 578 {
579 VectorUnusedSlotClearer<Allocator::heapAllocation && (VectorTraits<T >::needsDestruction || VectorTraits<T>::needsVisiting || VectorTraits<T>::isWeak ), T>::clear(from, to); 579 VectorUnusedSlotClearer<Allocator::heapAllocation && (VectorTraits<T >::needsDestruction || VectorTraits<T>::needsTracing || VectorTraits<T>::isWeak) , T>::clear(from, to);
580 } 580 }
581 581
582 Vector(const Vector&); 582 Vector(const Vector&);
583 template<size_t otherCapacity> 583 template<size_t otherCapacity>
584 Vector(const Vector<T, otherCapacity, Allocator>&); 584 Vector(const Vector<T, otherCapacity, Allocator>&);
585 585
586 Vector& operator=(const Vector&); 586 Vector& operator=(const Vector&);
587 template<size_t otherCapacity> 587 template<size_t otherCapacity>
588 Vector& operator=(const Vector<T, otherCapacity, Allocator>&); 588 Vector& operator=(const Vector<T, otherCapacity, Allocator>&);
589 589
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
1228 template<typename T> struct ValueCheck<Vector<T> > { 1228 template<typename T> struct ValueCheck<Vector<T> > {
1229 typedef Vector<T> TraitType; 1229 typedef Vector<T> TraitType;
1230 static void checkConsistency(const Vector<T>& v) 1230 static void checkConsistency(const Vector<T>& v)
1231 { 1231 {
1232 v.checkConsistency(); 1232 v.checkConsistency();
1233 } 1233 }
1234 }; 1234 };
1235 #endif 1235 #endif
1236 1236
1237 // This is only called if the allocator is a HeapAllocator. It is used when 1237 // This is only called if the allocator is a HeapAllocator. It is used when
1238 // visiting during a tracing GC. 1238 // tracing during a garbage collection.
1239 template<typename T, size_t inlineCapacity, typename Allocator> 1239 template<typename T, size_t inlineCapacity, typename Allocator>
1240 void Vector<T, inlineCapacity, Allocator>::trace(typename Allocator::Visitor * visitor) 1240 void Vector<T, inlineCapacity, Allocator>::trace(typename Allocator::Visitor * visitor)
1241 { 1241 {
1242 const T* bufferBegin = buffer(); 1242 const T* bufferBegin = buffer();
1243 const T* bufferEnd = buffer() + size(); 1243 const T* bufferEnd = buffer() + size();
1244 if (VectorTraits<T>::needsVisiting) { 1244 if (VectorTraits<T>::needsTracing) {
1245 for (const T* bufferEntry = bufferBegin; bufferEntry != bufferEnd; b ufferEntry++) 1245 for (const T* bufferEntry = bufferBegin; bufferEntry != bufferEnd; b ufferEntry++)
1246 Allocator::template visitWith<T, VectorTraits<T> >(visitor, *con st_cast<T*>(bufferEntry)); 1246 Allocator::template adjustAndMark<T, VectorTraits<T> >(visitor, *const_cast<T*>(bufferEntry));
1247 } 1247 }
1248 if (this->hasOutOfLineBuffer()) 1248 if (this->hasOutOfLineBuffer())
1249 Allocator::visitHeapPointer(visitor, buffer()); 1249 Allocator::visitHeapPointer(visitor, buffer());
1250 } 1250 }
1251 1251
1252 } // namespace WTF 1252 } // namespace WTF
1253 1253
1254 using WTF::Vector; 1254 using WTF::Vector;
1255 1255
1256 #endif // WTF_Vector_h 1256 #endif // WTF_Vector_h
OLDNEW
« no previous file with comments | « Source/wtf/TypeTraits.h ('k') | Source/wtf/VectorTraits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698