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

Unified Diff: runtime/vm/profiler.cc

Issue 92513002: Switch SetupIsolateForProfiling to use calloc instead of new [] (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/profiler.cc
diff --git a/runtime/vm/profiler.cc b/runtime/vm/profiler.cc
index 90d5a46ac786653e7b944a93b757e9aeb6c1a12c..d3b25f2daa5b6b6c1dc78b650add88eec76f455d 100644
--- a/runtime/vm/profiler.cc
+++ b/runtime/vm/profiler.cc
@@ -579,14 +579,17 @@ SampleBuffer::SampleBuffer(intptr_t capacity) {
start_ = 0;
end_ = 0;
capacity_ = capacity;
- samples_ = new Sample[capacity];
+ samples_ = reinterpret_cast<Sample*>(calloc(capacity, sizeof(Sample)));
}
SampleBuffer::~SampleBuffer() {
if (samples_ != NULL) {
- delete[] samples_;
+ free(samples_);
samples_ = NULL;
+ start_ = 0;
+ end_ = 0;
+ capacity_ = 0;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698