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

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

Issue 2680213002: Updated MallocHooks to collect stack traces when memory is allocated. (Closed)
Patch Set: Updated MallocHooks to collect stack traces when memory is allocated. Created 3 years, 10 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 | « runtime/vm/os_thread.h ('k') | runtime/vm/profiler.h » ('j') | 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) 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 "vm/globals.h" 5 #include "vm/globals.h"
6 #if defined(TARGET_OS_WINDOWS) 6 #if defined(TARGET_OS_WINDOWS)
7 7
8 #include "vm/os.h" 8 #include "vm/os.h"
9 9
10 #include <malloc.h> // NOLINT 10 #include <malloc.h> // NOLINT
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 __builtin_trap(); 258 __builtin_trap();
259 #else 259 #else
260 // Microsoft style assembly. 260 // Microsoft style assembly.
261 __asm { 261 __asm {
262 int 3 262 int 3
263 } 263 }
264 #endif 264 #endif
265 } 265 }
266 266
267 267
268 DART_NOINLINE uintptr_t OS::GetProgramCounter() {
269 return reinterpret_cast<uintptr_t>(_ReturnAddress());
270 }
271
272
268 char* OS::StrNDup(const char* s, intptr_t n) { 273 char* OS::StrNDup(const char* s, intptr_t n) {
269 intptr_t len = strlen(s); 274 intptr_t len = strlen(s);
270 if ((n < 0) || (len < 0)) { 275 if ((n < 0) || (len < 0)) {
271 return NULL; 276 return NULL;
272 } 277 }
273 if (n < len) { 278 if (n < len) {
274 len = n; 279 len = n;
275 } 280 }
276 char* result = reinterpret_cast<char*>(malloc(len + 1)); 281 char* result = reinterpret_cast<char*>(malloc(len + 1));
277 if (result == NULL) { 282 if (result == NULL) {
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 // TODO(zra): Remove once VM shuts down cleanly. 450 // TODO(zra): Remove once VM shuts down cleanly.
446 private_flag_windows_run_tls_destructors = false; 451 private_flag_windows_run_tls_destructors = false;
447 // On Windows we use ExitProcess so that threads can't clobber the exit_code. 452 // On Windows we use ExitProcess so that threads can't clobber the exit_code.
448 // See: https://code.google.com/p/nativeclient/issues/detail?id=2870 453 // See: https://code.google.com/p/nativeclient/issues/detail?id=2870
449 ::ExitProcess(code); 454 ::ExitProcess(code);
450 } 455 }
451 456
452 } // namespace dart 457 } // namespace dart
453 458
454 #endif // defined(TARGET_OS_WINDOWS) 459 #endif // defined(TARGET_OS_WINDOWS)
OLDNEW
« no previous file with comments | « runtime/vm/os_thread.h ('k') | runtime/vm/profiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698