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

Unified Diff: runtime/vm/profiler_test.cc

Issue 131853007: Add flag to control number of stack frames collected by profiler (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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
« runtime/vm/profiler.cc ('K') | « runtime/vm/profiler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
};
« runtime/vm/profiler.cc ('K') | « runtime/vm/profiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698