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

Side by Side Diff: vm/os_linux.cc

Issue 10782016: Enforce length/size limits for variable size heap object in order to (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 4 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
« no previous file with comments | « vm/os.h ('k') | vm/os_macos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <time.h> 9 #include <time.h>
10 #include <sys/resource.h> 10 #include <sys/resource.h>
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 const int kMinimumAlignment = 16; 94 const int kMinimumAlignment = 16;
95 #else 95 #else
96 #error Unsupported architecture. 96 #error Unsupported architecture.
97 #endif 97 #endif
98 word alignment = kMinimumAlignment; 98 word alignment = kMinimumAlignment;
99 // TODO(5411554): Allow overriding default code alignment for 99 // TODO(5411554): Allow overriding default code alignment for
100 // testing purposes. 100 // testing purposes.
101 // Flags::DebugIsInt("codealign", &alignment); 101 // Flags::DebugIsInt("codealign", &alignment);
102 ASSERT(Utils::IsPowerOfTwo(alignment)); 102 ASSERT(Utils::IsPowerOfTwo(alignment));
103 ASSERT(alignment >= kMinimumAlignment); 103 ASSERT(alignment >= kMinimumAlignment);
104 ASSERT(alignment <= OS::kMaxPreferredCodeAlignment);
104 return alignment; 105 return alignment;
105 } 106 }
106 107
107 108
108 uword OS::GetStackSizeLimit() { 109 uword OS::GetStackSizeLimit() {
109 struct rlimit stack_limit; 110 struct rlimit stack_limit;
110 int retval = getrlimit(RLIMIT_STACK, &stack_limit); 111 int retval = getrlimit(RLIMIT_STACK, &stack_limit);
111 ASSERT(retval == 0); 112 ASSERT(retval == 0);
112 if (stack_limit.rlim_cur > INT_MAX) { 113 if (stack_limit.rlim_cur > INT_MAX) {
113 retval = INT_MAX; 114 retval = INT_MAX;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 void OS::Abort() { 206 void OS::Abort() {
206 abort(); 207 abort();
207 } 208 }
208 209
209 210
210 void OS::Exit(int code) { 211 void OS::Exit(int code) {
211 exit(code); 212 exit(code);
212 } 213 }
213 214
214 } // namespace dart 215 } // namespace dart
OLDNEW
« no previous file with comments | « vm/os.h ('k') | vm/os_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698