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

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

Issue 358363002: Move platform abstraction to base library (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 5 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 | Annotate | Revision Log
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 FreeBSD goes here. For the POSIX-compatible 5 // Platform-specific code for FreeBSD 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 <pthread.h> 8 #include <pthread.h>
9 #include <semaphore.h> 9 #include <semaphore.h>
10 #include <signal.h> 10 #include <signal.h>
(...skipping 11 matching lines...) Expand all
22 // If you don't have execinfo.h then you need devel/libexecinfo from ports. 22 // If you don't have execinfo.h then you need devel/libexecinfo from ports.
23 #include <errno.h> 23 #include <errno.h>
24 #include <limits.h> 24 #include <limits.h>
25 #include <stdarg.h> 25 #include <stdarg.h>
26 #include <strings.h> // index 26 #include <strings.h> // index
27 27
28 #include <cmath> 28 #include <cmath>
29 29
30 #undef MAP_TYPE 30 #undef MAP_TYPE
31 31
32 #include "src/platform.h" 32 #include "src/base/macros.h"
33 #include "src/utils.h" 33 #include "src/base/platform/platform.h"
34 34
35 35
36 namespace v8 { 36 namespace v8 {
37 namespace internal { 37 namespace base {
38 38
39 39
40 const char* OS::LocalTimezone(double time, TimezoneCache* cache) { 40 const char* OS::LocalTimezone(double time, TimezoneCache* cache) {
41 if (std::isnan(time)) return ""; 41 if (std::isnan(time)) return "";
42 time_t tv = static_cast<time_t>(std::floor(time/msPerSecond)); 42 time_t tv = static_cast<time_t>(std::floor(time/msPerSecond));
43 struct tm* t = localtime(&tv); 43 struct tm* t = localtime(&tv);
44 if (NULL == t) return ""; 44 if (NULL == t) return "";
45 return t->tm_zone; 45 return t->tm_zone;
46 } 46 }
47 47
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 bool VirtualMemory::ReleaseRegion(void* base, size_t size) { 297 bool VirtualMemory::ReleaseRegion(void* base, size_t size) {
298 return munmap(base, size) == 0; 298 return munmap(base, size) == 0;
299 } 299 }
300 300
301 301
302 bool VirtualMemory::HasLazyCommits() { 302 bool VirtualMemory::HasLazyCommits() {
303 // TODO(alph): implement for the platform. 303 // TODO(alph): implement for the platform.
304 return false; 304 return false;
305 } 305 }
306 306
307 } } // namespace v8::internal 307 } } // namespace v8::base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698