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

Side by Side Diff: Source/platform/heap/Heap.h

Issue 390983010: Fix Deque.swap for deques with inline capacity Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use more fullnesses in test to improve coverage Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/wtf/Deque.h » ('j') | Source/wtf/Deque.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1666 matching lines...) Expand 10 before | Expand all | Expand 10 after
1677 HeapDeque() { } 1677 HeapDeque() { }
1678 1678
1679 explicit HeapDeque(size_t size) : Deque<T, inlineCapacity, HeapAllocator>(si ze) 1679 explicit HeapDeque(size_t size) : Deque<T, inlineCapacity, HeapAllocator>(si ze)
1680 { 1680 {
1681 } 1681 }
1682 1682
1683 HeapDeque(size_t size, const T& val) : Deque<T, inlineCapacity, HeapAllocato r>(size, val) 1683 HeapDeque(size_t size, const T& val) : Deque<T, inlineCapacity, HeapAllocato r>(size, val)
1684 { 1684 {
1685 } 1685 }
1686 1686
1687 // FIXME: Doesn't work if there is an inline buffer, due to crbug.com/360572 1687 HeapDeque& operator=(const HeapDeque& other)
1688 HeapDeque<T, 0>& operator=(const HeapDeque& other)
1689 { 1688 {
1690 HeapDeque<T> copy(other); 1689 HeapDeque<T> copy(other);
1691 swap(copy); 1690 swap(copy);
1692 return *this; 1691 return *this;
1693 } 1692 }
1694 1693
1695 // FIXME: Doesn't work if there is an inline buffer, due to crbug.com/360572
1696 inline void swap(HeapDeque& other) 1694 inline void swap(HeapDeque& other)
1697 { 1695 {
1698 Deque<T, inlineCapacity, HeapAllocator>::swap(other); 1696 Deque<T, inlineCapacity, HeapAllocator>::swap(other);
1699 } 1697 }
1700 1698
1701 template<size_t otherCapacity> 1699 template<size_t otherCapacity>
1702 HeapDeque(const HeapDeque<T, otherCapacity>& other) 1700 HeapDeque(const HeapDeque<T, otherCapacity>& other)
1703 : Deque<T, inlineCapacity, HeapAllocator>(other) 1701 : Deque<T, inlineCapacity, HeapAllocator>(other)
1704 { 1702 {
1705 } 1703 }
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
2347 }; 2345 };
2348 2346
2349 template<typename T> 2347 template<typename T>
2350 struct IfWeakMember<WeakMember<T> > { 2348 struct IfWeakMember<WeakMember<T> > {
2351 static bool isDead(Visitor* visitor, const WeakMember<T>& t) { return !visit or->isAlive(t.get()); } 2349 static bool isDead(Visitor* visitor, const WeakMember<T>& t) { return !visit or->isAlive(t.get()); }
2352 }; 2350 };
2353 2351
2354 } 2352 }
2355 2353
2356 #endif // Heap_h 2354 #endif // Heap_h
OLDNEW
« no previous file with comments | « no previous file | Source/wtf/Deque.h » ('j') | Source/wtf/Deque.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698