| Index: runtime/vm/profiler_test.cc
|
| diff --git a/runtime/vm/profiler_test.cc b/runtime/vm/profiler_test.cc
|
| index b0c580e70eec33eef1e0d3c2df6cd821027966be..1d60853440f5279b5095831c037e77850023f327 100644
|
| --- a/runtime/vm/profiler_test.cc
|
| +++ b/runtime/vm/profiler_test.cc
|
| @@ -17,13 +17,15 @@ class ProfileSampleBufferTestHelper {
|
| static intptr_t IterateCount(const Isolate* isolate,
|
| const SampleBuffer& sample_buffer) {
|
| intptr_t c = 0;
|
| + Sample* sample = Sample::Allocate();
|
| for (intptr_t i = 0; i < sample_buffer.capacity(); i++) {
|
| - Sample sample = sample_buffer.GetSample(i);
|
| - if (sample.isolate != isolate) {
|
| + sample_buffer.CopySample(i, sample);
|
| + if (sample->isolate != isolate) {
|
| continue;
|
| }
|
| c++;
|
| }
|
| + free(sample);
|
| return c;
|
| }
|
|
|
| @@ -31,13 +33,15 @@ class ProfileSampleBufferTestHelper {
|
| static intptr_t IterateSumPC(const Isolate* isolate,
|
| const SampleBuffer& sample_buffer) {
|
| intptr_t c = 0;
|
| + Sample* sample = Sample::Allocate();
|
| for (intptr_t i = 0; i < sample_buffer.capacity(); i++) {
|
| - Sample sample = sample_buffer.GetSample(i);
|
| - if (sample.isolate != isolate) {
|
| + sample_buffer.CopySample(i, sample);
|
| + if (sample->isolate != isolate) {
|
| continue;
|
| }
|
| - c += sample.pcs[0];
|
| + c += sample->pcs[0];
|
| }
|
| + free(sample);
|
| return c;
|
| }
|
| };
|
|
|