Index: runtime/vm/os_macos.cc |
diff --git a/runtime/vm/os_macos.cc b/runtime/vm/os_macos.cc |
index db3adbb874034f1b5d92954f00c5ae24b94c3e13..7038dd55a292fb5a979a001b752a2e26eaed8f3c 100644 |
--- a/runtime/vm/os_macos.cc |
+++ b/runtime/vm/os_macos.cc |
@@ -7,17 +7,17 @@ |
#include "vm/os.h" |
-#include <errno.h> // NOLINT |
-#include <limits.h> // NOLINT |
-#include <mach/mach.h> // NOLINT |
-#include <mach/clock.h> // NOLINT |
+#include <errno.h> // NOLINT |
+#include <limits.h> // NOLINT |
+#include <mach/mach.h> // NOLINT |
+#include <mach/clock.h> // NOLINT |
#include <mach/mach_time.h> // NOLINT |
-#include <sys/time.h> // NOLINT |
-#include <sys/resource.h> // NOLINT |
-#include <unistd.h> // NOLINT |
+#include <sys/time.h> // NOLINT |
+#include <sys/resource.h> // NOLINT |
+#include <unistd.h> // NOLINT |
#if TARGET_OS_IOS |
#include <sys/sysctl.h> // NOLINT |
-#include <syslog.h> // NOLINT |
+#include <syslog.h> // NOLINT |
#endif |
#include "platform/utils.h" |
@@ -153,8 +153,8 @@ int64_t OS::GetCurrentThreadCPUMicros() { |
if (thread_port == MACH_PORT_NULL) { |
return -1; |
} |
- kern_return_t r = thread_info(thread_port, THREAD_BASIC_INFO, |
- (thread_info_t)info, &count); |
+ kern_return_t r = |
+ thread_info(thread_port, THREAD_BASIC_INFO, (thread_info_t)info, &count); |
mach_port_deallocate(mach_task_self(), thread_port); |
ASSERT(r == KERN_SUCCESS); |
int64_t thread_cpu_micros = |
@@ -183,7 +183,7 @@ intptr_t OS::ActivationFrameAlignment() { |
#else |
#error Unimplemented |
#endif |
-#else // TARGET_OS_IOS |
+#else // TARGET_OS_IOS |
// OS X activation frames must be 16 byte-aligned; see "Mac OS X ABI |
// Function Call Guide". |
return 16; |
@@ -192,10 +192,8 @@ intptr_t OS::ActivationFrameAlignment() { |
intptr_t OS::PreferredCodeAlignment() { |
-#if defined(TARGET_ARCH_IA32) || \ |
- defined(TARGET_ARCH_X64) || \ |
- defined(TARGET_ARCH_ARM64) || \ |
- defined(TARGET_ARCH_DBC) |
+#if defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64) || \ |
+ defined(TARGET_ARCH_ARM64) || defined(TARGET_ARCH_DBC) |
const int kMinimumAlignment = 32; |
#elif defined(TARGET_ARCH_ARM) || defined(TARGET_ARCH_MIPS) |
const int kMinimumAlignment = 16; |
@@ -269,9 +267,9 @@ void OS::DebugBreak() { |
char* OS::StrNDup(const char* s, intptr_t n) { |
- // strndup has only been added to Mac OS X in 10.7. We are supplying |
- // our own copy here if needed. |
-#if !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || \ |
+// strndup has only been added to Mac OS X in 10.7. We are supplying |
+// our own copy here if needed. |
+#if !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || \ |
__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ <= 1060 |
intptr_t len = strlen(s); |
if ((n < 0) || (len < 0)) { |
@@ -286,16 +284,16 @@ char* OS::StrNDup(const char* s, intptr_t n) { |
} |
result[len] = '\0'; |
return reinterpret_cast<char*>(memmove(result, s, len)); |
-#else // !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || ... |
+#else // !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || ... |
return strndup(s, n); |
#endif // !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || ... |
} |
intptr_t OS::StrNLen(const char* s, intptr_t n) { |
- // strnlen has only been added to Mac OS X in 10.7. We are supplying |
- // our own copy here if needed. |
-#if !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || \ |
+// strnlen has only been added to Mac OS X in 10.7. We are supplying |
+// our own copy here if needed. |
+#if !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || \ |
__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ <= 1060 |
intptr_t len = 0; |
while ((len <= n) && (*s != '\0')) { |
@@ -303,7 +301,7 @@ intptr_t OS::StrNLen(const char* s, intptr_t n) { |
len++; |
} |
return len; |
-#else // !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || ... |
+#else // !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || ... |
return strnlen(s, n); |
#endif // !defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) || ... |
} |
@@ -389,8 +387,7 @@ bool OS::StringToInt64(const char* str, int64_t* value) { |
if (str[0] == '-') { |
i = 1; |
} |
- if ((str[i] == '0') && |
- (str[i + 1] == 'x' || str[i + 1] == 'X') && |
+ if ((str[i] == '0') && (str[i + 1] == 'x' || str[i + 1] == 'X') && |
(str[i + 2] != '\0')) { |
base = 16; |
} |
@@ -400,8 +397,7 @@ bool OS::StringToInt64(const char* str, int64_t* value) { |
} |
-void OS::RegisterCodeObservers() { |
-} |
+void OS::RegisterCodeObservers() {} |
void OS::PrintErr(const char* format, ...) { |
@@ -429,8 +425,7 @@ void OS::InitOnce() { |
} |
-void OS::Shutdown() { |
-} |
+void OS::Shutdown() {} |
void OS::Abort() { |