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

Side by Side Diff: runtime/vm/profiler.cc

Issue 2990193002: [vm] Free the sample buffer on shutdown for platform where we don't use SIGPROF. (Closed)
Patch Set: Created 3 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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/address_sanitizer.h" 5 #include "platform/address_sanitizer.h"
6 #include "platform/memory_sanitizer.h" 6 #include "platform/memory_sanitizer.h"
7 #include "platform/utils.h" 7 #include "platform/utils.h"
8 8
9 #include "vm/allocation.h" 9 #include "vm/allocation.h"
10 #include "vm/atomic.h" 10 #include "vm/atomic.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } 90 }
91 } 91 }
92 92
93 void Profiler::Shutdown() { 93 void Profiler::Shutdown() {
94 if (!FLAG_profiler) { 94 if (!FLAG_profiler) {
95 return; 95 return;
96 } 96 }
97 ASSERT(initialized_); 97 ASSERT(initialized_);
98 ThreadInterrupter::Shutdown(); 98 ThreadInterrupter::Shutdown();
99 NativeSymbolResolver::ShutdownOnce(); 99 NativeSymbolResolver::ShutdownOnce();
100 #if defined(HOST_OS_LINUX) || defined(HOST_OS_MACOS) || defined(HOST_OS_ANDROID)
101 // TODO(30309): Free the sample buffer on platforms that use a signal-based
102 // thread interrupter.
103 #else
104 delete sample_buffer_;
105 sample_buffer_ = NULL;
106 #endif
100 } 107 }
101 108
102 void Profiler::SetSampleDepth(intptr_t depth) { 109 void Profiler::SetSampleDepth(intptr_t depth) {
103 const int kMinimumDepth = 2; 110 const int kMinimumDepth = 2;
104 const int kMaximumDepth = 255; 111 const int kMaximumDepth = 255;
105 if (depth < kMinimumDepth) { 112 if (depth < kMinimumDepth) {
106 FLAG_max_profile_depth = kMinimumDepth; 113 FLAG_max_profile_depth = kMinimumDepth;
107 } else if (depth > kMaximumDepth) { 114 } else if (depth > kMaximumDepth) {
108 FLAG_max_profile_depth = kMaximumDepth; 115 FLAG_max_profile_depth = kMaximumDepth;
109 } else { 116 } else {
(...skipping 1571 matching lines...) Expand 10 before | Expand all | Expand 10 after
1681 } 1688 }
1682 1689
1683 ProcessedSampleBuffer::ProcessedSampleBuffer() 1690 ProcessedSampleBuffer::ProcessedSampleBuffer()
1684 : code_lookup_table_(new CodeLookupTable(Thread::Current())) { 1691 : code_lookup_table_(new CodeLookupTable(Thread::Current())) {
1685 ASSERT(code_lookup_table_ != NULL); 1692 ASSERT(code_lookup_table_ != NULL);
1686 } 1693 }
1687 1694
1688 #endif // !PRODUCT 1695 #endif // !PRODUCT
1689 1696
1690 } // namespace dart 1697 } // namespace dart
OLDNEW
« 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