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

Side by Side Diff: src/base/platform/platform-macos.cc

Issue 1369673003: [presubmit] Enable runtime/threadsafe_fn linter checking. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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 | « src/base/platform/platform-linux.cc ('k') | src/base/platform/platform-openbsd.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Platform-specific code for MacOS goes here. For the POSIX-compatible 5 // Platform-specific code for MacOS goes here. For the POSIX-compatible
6 // parts, the implementation is in platform-posix.cc. 6 // parts, the implementation is in platform-posix.cc.
7 7
8 #include <dlfcn.h> 8 #include <dlfcn.h>
9 #include <mach/mach_init.h> 9 #include <mach/mach_init.h>
10 #include <mach-o/dyld.h> 10 #include <mach-o/dyld.h>
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 } 95 }
96 96
97 97
98 void OS::SignalCodeMovingGC() { 98 void OS::SignalCodeMovingGC() {
99 } 99 }
100 100
101 101
102 const char* OS::LocalTimezone(double time, TimezoneCache* cache) { 102 const char* OS::LocalTimezone(double time, TimezoneCache* cache) {
103 if (std::isnan(time)) return ""; 103 if (std::isnan(time)) return "";
104 time_t tv = static_cast<time_t>(std::floor(time/msPerSecond)); 104 time_t tv = static_cast<time_t>(std::floor(time/msPerSecond));
105 struct tm* t = localtime(&tv); 105 struct tm* t = localtime(&tv); // NOLINT(runtime/threadsafe_fn)
106 if (NULL == t) return ""; 106 if (NULL == t) return "";
107 return t->tm_zone; 107 return t->tm_zone;
108 } 108 }
109 109
110 110
111 double OS::LocalTimeOffset(TimezoneCache* cache) { 111 double OS::LocalTimeOffset(TimezoneCache* cache) {
112 time_t tv = time(NULL); 112 time_t tv = time(NULL);
113 struct tm* t = localtime(&tv); 113 struct tm* t = localtime(&tv); // NOLINT(runtime/threadsafe_fn)
114 // tm_gmtoff includes any daylight savings offset, so subtract it. 114 // tm_gmtoff includes any daylight savings offset, so subtract it.
115 return static_cast<double>(t->tm_gmtoff * msPerSecond - 115 return static_cast<double>(t->tm_gmtoff * msPerSecond -
116 (t->tm_isdst > 0 ? 3600 * msPerSecond : 0)); 116 (t->tm_isdst > 0 ? 3600 * msPerSecond : 0));
117 } 117 }
118 118
119 119
120 VirtualMemory::VirtualMemory() : address_(NULL), size_(0) { } 120 VirtualMemory::VirtualMemory() : address_(NULL), size_(0) { }
121 121
122 122
123 VirtualMemory::VirtualMemory(size_t size) 123 VirtualMemory::VirtualMemory(size_t size)
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 bool VirtualMemory::ReleaseRegion(void* address, size_t size) { 243 bool VirtualMemory::ReleaseRegion(void* address, size_t size) {
244 return munmap(address, size) == 0; 244 return munmap(address, size) == 0;
245 } 245 }
246 246
247 247
248 bool VirtualMemory::HasLazyCommits() { 248 bool VirtualMemory::HasLazyCommits() {
249 return false; 249 return false;
250 } 250 }
251 251
252 } } // namespace v8::base 252 } } // namespace v8::base
OLDNEW
« no previous file with comments | « src/base/platform/platform-linux.cc ('k') | src/base/platform/platform-openbsd.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698