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

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

Issue 2711353003: Fixed tests not having MallocHooks initialized for tests in release mode. (Closed)
Patch Set: 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_linux.cc ('k') | runtime/vm/os_thread.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_MACOS) 6 #if defined(TARGET_OS_MACOS)
7 7
8 #include "vm/os.h" 8 #include "vm/os.h"
9 9
10 #include <errno.h> // NOLINT 10 #include <errno.h> // NOLINT
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 req = rem; 259 req = rem;
260 } 260 }
261 } 261 }
262 262
263 263
264 void OS::DebugBreak() { 264 void OS::DebugBreak() {
265 __builtin_trap(); 265 __builtin_trap();
266 } 266 }
267 267
268 268
269 uintptr_t DART_NOINLINE OS::GetProgramCounter() {
270 return reinterpret_cast<uintptr_t>(
271 __builtin_extract_return_addr(__builtin_return_address(0)));
272 }
273
274
269 char* OS::StrNDup(const char* s, intptr_t n) { 275 char* OS::StrNDup(const char* s, intptr_t n) {
270 // strndup has only been added to Mac OS X in 10.7. We are supplying 276 // strndup has only been added to Mac OS X in 10.7. We are supplying
271 // our own copy here if needed. 277 // our own copy here if needed.
272 #if !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || \ 278 #if !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || \
273 __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ <= 1060 279 __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ <= 1060
274 intptr_t len = strlen(s); 280 intptr_t len = strlen(s);
275 if ((n < 0) || (len < 0)) { 281 if ((n < 0) || (len < 0)) {
276 return NULL; 282 return NULL;
277 } 283 }
278 if (n < len) { 284 if (n < len) {
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 } 439 }
434 440
435 441
436 void OS::Exit(int code) { 442 void OS::Exit(int code) {
437 exit(code); 443 exit(code);
438 } 444 }
439 445
440 } // namespace dart 446 } // namespace dart
441 447
442 #endif // defined(TARGET_OS_MACOS) 448 #endif // defined(TARGET_OS_MACOS)
OLDNEW
« no previous file with comments | « runtime/vm/os_linux.cc ('k') | runtime/vm/os_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698