OLD | NEW |
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 Solaris 10 goes here. For the POSIX-compatible | 5 // Platform-specific code for Solaris 10 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 #ifdef __sparc | 8 #ifdef __sparc |
9 # error "V8 does not support the SPARC CPU architecture." | 9 # error "V8 does not support the SPARC CPU architecture." |
10 #endif | 10 #endif |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "src/base/platform/platform.h" | 31 #include "src/base/platform/platform.h" |
32 | 32 |
33 | 33 |
34 namespace v8 { | 34 namespace v8 { |
35 namespace base { | 35 namespace base { |
36 | 36 |
37 | 37 |
38 const char* OS::LocalTimezone(double time, TimezoneCache* cache) { | 38 const char* OS::LocalTimezone(double time, TimezoneCache* cache) { |
39 if (std::isnan(time)) return ""; | 39 if (std::isnan(time)) return ""; |
40 time_t tv = static_cast<time_t>(std::floor(time/msPerSecond)); | 40 time_t tv = static_cast<time_t>(std::floor(time/msPerSecond)); |
41 struct tm* t = localtime(&tv); | 41 struct tm* t = localtime(&tv); // NOLINT(runtime/threadsafe_fn) |
42 if (NULL == t) return ""; | 42 if (NULL == t) return ""; |
43 return tzname[0]; // The location of the timezone string on Solaris. | 43 return tzname[0]; // The location of the timezone string on Solaris. |
44 } | 44 } |
45 | 45 |
46 | 46 |
47 double OS::LocalTimeOffset(TimezoneCache* cache) { | 47 double OS::LocalTimeOffset(TimezoneCache* cache) { |
48 tzset(); | 48 tzset(); |
49 return -static_cast<double>(timezone * msPerSecond); | 49 return -static_cast<double>(timezone * msPerSecond); |
50 } | 50 } |
51 | 51 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 return munmap(base, size) == 0; | 202 return munmap(base, size) == 0; |
203 } | 203 } |
204 | 204 |
205 | 205 |
206 bool VirtualMemory::HasLazyCommits() { | 206 bool VirtualMemory::HasLazyCommits() { |
207 // TODO(alph): implement for the platform. | 207 // TODO(alph): implement for the platform. |
208 return false; | 208 return false; |
209 } | 209 } |
210 | 210 |
211 } } // namespace v8::base | 211 } } // namespace v8::base |
OLD | NEW |