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

Unified Diff: Source/wtf/Vector.h

Issue 456633002: Oilpan: Assert that updator functions of HashMap, HashSet, and Vector should not be used during wea… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/wtf/HashTable.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/Vector.h
diff --git a/Source/wtf/Vector.h b/Source/wtf/Vector.h
index 8833e499b2eb63cdb3173454dd103e161b32f962..834fd0ccc9aeaf82f156d7ba96e0f50079d94c3d 100644
--- a/Source/wtf/Vector.h
+++ b/Source/wtf/Vector.h
@@ -1012,6 +1012,7 @@ static const size_t kInitialVectorSize = WTF_VECTOR_INITIAL_SIZE;
template<typename T, size_t inlineCapacity, typename Allocator> template<typename U>
void Vector<T, inlineCapacity, Allocator>::append(const U* data, size_t dataSize)
{
+ ASSERT(Allocator::isAllocationAllowed());
size_t newSize = m_size + dataSize;
if (newSize > capacity()) {
data = expandCapacity(newSize, data);
@@ -1026,6 +1027,7 @@ static const size_t kInitialVectorSize = WTF_VECTOR_INITIAL_SIZE;
template<typename T, size_t inlineCapacity, typename Allocator> template<typename U>
ALWAYS_INLINE void Vector<T, inlineCapacity, Allocator>::append(const U& val)
{
+ ASSERT(Allocator::isAllocationAllowed());
if (LIKELY(size() != capacity())) {
new (NotNull, end()) T(val);
++m_size;
@@ -1069,6 +1071,7 @@ static const size_t kInitialVectorSize = WTF_VECTOR_INITIAL_SIZE;
template<typename T, size_t inlineCapacity, typename Allocator> template<typename U>
void Vector<T, inlineCapacity, Allocator>::insert(size_t position, const U* data, size_t dataSize)
{
+ ASSERT(Allocator::isAllocationAllowed());
RELEASE_ASSERT(position <= size());
size_t newSize = m_size + dataSize;
if (newSize > capacity()) {
@@ -1085,6 +1088,7 @@ static const size_t kInitialVectorSize = WTF_VECTOR_INITIAL_SIZE;
template<typename T, size_t inlineCapacity, typename Allocator> template<typename U>
inline void Vector<T, inlineCapacity, Allocator>::insert(size_t position, const U& val)
{
+ ASSERT(Allocator::isAllocationAllowed());
RELEASE_ASSERT(position <= size());
const U* data = &val;
if (size() == capacity()) {
« no previous file with comments | « Source/wtf/HashTable.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698