| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/os.h" | 5 #include "vm/os.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <limits.h> | 8 #include <limits.h> |
| 9 #include <mach/mach.h> | 9 #include <mach/mach.h> |
| 10 #include <mach/clock.h> | 10 #include <mach/clock.h> |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 | 69 |
| 70 | 70 |
| 71 word OS::ActivationFrameAlignment() { | 71 word OS::ActivationFrameAlignment() { |
| 72 // OS X activation frames must be 16 byte-aligned; see "Mac OS X ABI | 72 // OS X activation frames must be 16 byte-aligned; see "Mac OS X ABI |
| 73 // Function Call Guide". | 73 // Function Call Guide". |
| 74 return 16; | 74 return 16; |
| 75 } | 75 } |
| 76 | 76 |
| 77 | 77 |
| 78 word OS::PreferredCodeAlignment() { | 78 word OS::PreferredCodeAlignment() { |
| 79 ASSERT(32 <= OS::kMaxPreferredCodeAlignment); |
| 79 return 32; | 80 return 32; |
| 80 } | 81 } |
| 81 | 82 |
| 82 | 83 |
| 83 uword OS::GetStackSizeLimit() { | 84 uword OS::GetStackSizeLimit() { |
| 84 struct rlimit stack_limit; | 85 struct rlimit stack_limit; |
| 85 int retval = getrlimit(RLIMIT_STACK, &stack_limit); | 86 int retval = getrlimit(RLIMIT_STACK, &stack_limit); |
| 86 ASSERT(retval == 0); | 87 ASSERT(retval == 0); |
| 87 if (stack_limit.rlim_cur > INT_MAX) { | 88 if (stack_limit.rlim_cur > INT_MAX) { |
| 88 retval = INT_MAX; | 89 retval = INT_MAX; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 void OS::Abort() { | 181 void OS::Abort() { |
| 181 abort(); | 182 abort(); |
| 182 } | 183 } |
| 183 | 184 |
| 184 | 185 |
| 185 void OS::Exit(int code) { | 186 void OS::Exit(int code) { |
| 186 exit(code); | 187 exit(code); |
| 187 } | 188 } |
| 188 | 189 |
| 189 } // namespace dart | 190 } // namespace dart |
| OLD | NEW |