OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 LOG(isolate, | 195 LOG(isolate, |
196 SharedLibraryEvent(_dyld_get_image_name(i), start, start + size)); | 196 SharedLibraryEvent(_dyld_get_image_name(i), start, start + size)); |
197 } | 197 } |
198 } | 198 } |
199 | 199 |
200 | 200 |
201 void OS::SignalCodeMovingGC() { | 201 void OS::SignalCodeMovingGC() { |
202 } | 202 } |
203 | 203 |
204 | 204 |
| 205 uintptr_t OS::TotalPhysicalMemory() { |
| 206 int mib[2]; |
| 207 mib[0] = CTL_HW; |
| 208 mib[1] = HW_MEMSIZE; |
| 209 int64_t size = 0; |
| 210 size_t len = sizeof(size); |
| 211 if (sysctl(mib, 2, &size, &len, NULL, 0) == 0) |
| 212 return static_cast<uintptr_t> size; |
| 213 UNREACHABLE(); |
| 214 return 0; |
| 215 } |
| 216 |
| 217 |
205 const char* OS::LocalTimezone(double time) { | 218 const char* OS::LocalTimezone(double time) { |
206 if (std::isnan(time)) return ""; | 219 if (std::isnan(time)) return ""; |
207 time_t tv = static_cast<time_t>(floor(time/msPerSecond)); | 220 time_t tv = static_cast<time_t>(floor(time/msPerSecond)); |
208 struct tm* t = localtime(&tv); | 221 struct tm* t = localtime(&tv); |
209 if (NULL == t) return ""; | 222 if (NULL == t) return ""; |
210 return t->tm_zone; | 223 return t->tm_zone; |
211 } | 224 } |
212 | 225 |
213 | 226 |
214 double OS::LocalTimeOffset() { | 227 double OS::LocalTimeOffset() { |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 bool VirtualMemory::ReleaseRegion(void* address, size_t size) { | 359 bool VirtualMemory::ReleaseRegion(void* address, size_t size) { |
347 return munmap(address, size) == 0; | 360 return munmap(address, size) == 0; |
348 } | 361 } |
349 | 362 |
350 | 363 |
351 bool VirtualMemory::HasLazyCommits() { | 364 bool VirtualMemory::HasLazyCommits() { |
352 return false; | 365 return false; |
353 } | 366 } |
354 | 367 |
355 } } // namespace v8::internal | 368 } } // namespace v8::internal |
OLD | NEW |