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

Unified Diff: runtime/vm/os_macos.cc

Issue 1991013002: Allow Dart_TimelineGetMicros to be called before Dart_Initialize on Mac (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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
« 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/os_macos.cc
diff --git a/runtime/vm/os_macos.cc b/runtime/vm/os_macos.cc
index 14712d0291ca4397c29dabfa4d76391161d786b6..0ed04ec15be3a82280879e4e62194f9e3a73fc4a 100644
--- a/runtime/vm/os_macos.cc
+++ b/runtime/vm/os_macos.cc
@@ -109,6 +109,10 @@ int64_t OS::GetCurrentMonotonicTicks() {
origin += boottime.tv_usec;
return now - origin;
#else
+ if (timebase_info.denom == 0) {
+ kern_return_t kr = mach_timebase_info(&timebase_info);
+ ASSERT(KERN_SUCCESS == kr);
+ }
ASSERT(timebase_info.denom != 0);
// timebase_info converts absolute time tick units into nanoseconds.
int64_t result = mach_absolute_time();
@@ -429,8 +433,6 @@ void OS::InitOnce() {
static bool init_once_called = false;
ASSERT(init_once_called == false);
init_once_called = true;
- kern_return_t kr = mach_timebase_info(&timebase_info);
- ASSERT(KERN_SUCCESS == kr);
}
« 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