OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 // limit. | 63 // limit. |
64 | 64 |
65 intptr_t OS::MaxVirtualMemory() { | 65 intptr_t OS::MaxVirtualMemory() { |
66 struct rlimit limit; | 66 struct rlimit limit; |
67 int result = getrlimit(RLIMIT_DATA, &limit); | 67 int result = getrlimit(RLIMIT_DATA, &limit); |
68 if (result != 0) return 0; | 68 if (result != 0) return 0; |
69 return limit.rlim_cur; | 69 return limit.rlim_cur; |
70 } | 70 } |
71 | 71 |
72 | 72 |
| 73 #ifndef __CYGWIN__ |
73 // Get rid of writable permission on code allocations. | 74 // Get rid of writable permission on code allocations. |
74 void OS::ProtectCode(void* address, const size_t size) { | 75 void OS::ProtectCode(void* address, const size_t size) { |
75 mprotect(address, size, PROT_READ | PROT_EXEC); | 76 mprotect(address, size, PROT_READ | PROT_EXEC); |
76 } | 77 } |
77 | 78 |
78 | 79 |
79 // Create guard pages. | 80 // Create guard pages. |
80 void OS::Guard(void* address, const size_t size) { | 81 void OS::Guard(void* address, const size_t size) { |
81 mprotect(address, size, PROT_NONE); | 82 mprotect(address, size, PROT_NONE); |
82 } | 83 } |
| 84 #endif // __CYGWIN__ |
83 | 85 |
84 | 86 |
85 // ---------------------------------------------------------------------------- | 87 // ---------------------------------------------------------------------------- |
86 // Math functions | 88 // Math functions |
87 | 89 |
88 double modulo(double x, double y) { | 90 double modulo(double x, double y) { |
89 return fmod(x, y); | 91 return fmod(x, y); |
90 } | 92 } |
91 | 93 |
92 | 94 |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 return ntohl(value); | 457 return ntohl(value); |
456 } | 458 } |
457 | 459 |
458 | 460 |
459 Socket* OS::CreateSocket() { | 461 Socket* OS::CreateSocket() { |
460 return new POSIXSocket(); | 462 return new POSIXSocket(); |
461 } | 463 } |
462 | 464 |
463 | 465 |
464 } } // namespace v8::internal | 466 } } // namespace v8::internal |
OLD | NEW |