OLD | NEW |
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 6133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6144 | 6144 |
6145 namespace blink { | 6145 namespace blink { |
6146 | 6146 |
6147 TEST(HeapTest, DequePartObjectsExpand) | 6147 TEST(HeapTest, DequePartObjectsExpand) |
6148 { | 6148 { |
6149 // Test expansion of HeapDeque<PartObject> | 6149 // Test expansion of HeapDeque<PartObject> |
6150 | 6150 |
6151 using PartDeque = HeapDeque<PartObjectWithRef>; | 6151 using PartDeque = HeapDeque<PartObjectWithRef>; |
6152 | 6152 |
6153 Persistent<PartDeque> deque = new PartDeque(); | 6153 Persistent<PartDeque> deque = new PartDeque(); |
6154 // Auxillary Deque used to prevent 'inline' buffer expansion. | 6154 // Auxiliary Deque used to prevent 'inline' buffer expansion. |
6155 Persistent<PartDeque> dequeUnused = new PartDeque(); | 6155 Persistent<PartDeque> dequeUnused = new PartDeque(); |
6156 | 6156 |
6157 // Append a sequence, bringing about repeated expansions of the | 6157 // Append a sequence, bringing about repeated expansions of the |
6158 // deque's buffer. | 6158 // deque's buffer. |
6159 int i = 0; | 6159 int i = 0; |
6160 for (; i < 60; ++i) { | 6160 for (; i < 60; ++i) { |
6161 deque->append(PartObjectWithRef(i)); | 6161 deque->append(PartObjectWithRef(i)); |
6162 dequeUnused->append(PartObjectWithRef(i)); | 6162 dequeUnused->append(PartObjectWithRef(i)); |
6163 } | 6163 } |
6164 | 6164 |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6490 EXPECT_EQ(1u, vector2.size()); | 6490 EXPECT_EQ(1u, vector2.size()); |
6491 // TODO(Oilpan): when Vector.h's contiguous container support no longer disables | 6491 // TODO(Oilpan): when Vector.h's contiguous container support no longer disables |
6492 // Vector<>s with inline capacity, remove. | 6492 // Vector<>s with inline capacity, remove. |
6493 #if !defined(ANNOTATE_CONTIGUOUS_CONTAINER) | 6493 #if !defined(ANNOTATE_CONTIGUOUS_CONTAINER) |
6494 EXPECT_EQ(16u, vector1.capacity()); | 6494 EXPECT_EQ(16u, vector1.capacity()); |
6495 EXPECT_EQ(16u, vector2.capacity()); | 6495 EXPECT_EQ(16u, vector2.capacity()); |
6496 #endif | 6496 #endif |
6497 } | 6497 } |
6498 | 6498 |
6499 } // namespace blink | 6499 } // namespace blink |
OLD | NEW |