| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/assert.h" |
| 5 #include "vm/heap_profiler.h" | 6 #include "vm/heap_profiler.h" |
| 6 #include "vm/growable_array.h" | 7 #include "vm/growable_array.h" |
| 7 #include "vm/unit_test.h" | 8 #include "vm/unit_test.h" |
| 8 | 9 |
| 9 namespace dart { | 10 namespace dart { |
| 10 | 11 |
| 11 static void WriteCallback(const void* data, intptr_t length, void* stream) { | 12 static void WriteCallback(const void* data, intptr_t length, void* stream) { |
| 12 GrowableArray<uint8_t>* array = | 13 GrowableArray<uint8_t>* array = |
| 13 reinterpret_cast<GrowableArray<uint8_t>*>(stream); | 14 reinterpret_cast<GrowableArray<uint8_t>*>(stream); |
| 14 for (intptr_t i = 0; i < length; ++i) { | 15 for (intptr_t i = 0; i < length; ++i) { |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 EXPECT_GE(after, time + time_diff); | 109 EXPECT_GE(after, time + time_diff); |
| 109 // Check length diff | 110 // Check length diff |
| 110 uint32_t length = Read32(&array, &i); | 111 uint32_t length = Read32(&array, &i); |
| 111 EXPECT_LE((intptr_t)length + i , array.length()); | 112 EXPECT_LE((intptr_t)length + i , array.length()); |
| 112 // skip body | 113 // skip body |
| 113 i += length; | 114 i += length; |
| 114 } | 115 } |
| 115 } | 116 } |
| 116 | 117 |
| 117 } // namespace dart | 118 } // namespace dart |
| OLD | NEW |