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

Side by Side Diff: runtime/platform/globals.h

Issue 10695009: Add a platform-independent max uword value. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
« no previous file with comments | « no previous file | runtime/vm/debugger.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 #ifndef PLATFORM_GLOBALS_H_ 5 #ifndef PLATFORM_GLOBALS_H_
6 #define PLATFORM_GLOBALS_H_ 6 #define PLATFORM_GLOBALS_H_
7 7
8 // __STDC_FORMAT_MACROS has to be defined to enable platform independent printf. 8 // __STDC_FORMAT_MACROS has to be defined to enable platform independent printf.
9 #ifndef __STDC_FORMAT_MACROS 9 #ifndef __STDC_FORMAT_MACROS
10 #define __STDC_FORMAT_MACROS 10 #define __STDC_FORMAT_MACROS
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 144
145 // Types for native machine words. Guaranteed to be able to hold pointers and 145 // Types for native machine words. Guaranteed to be able to hold pointers and
146 // integers. 146 // integers.
147 typedef intptr_t word; 147 typedef intptr_t word;
148 typedef uintptr_t uword; 148 typedef uintptr_t uword;
149 149
150 // Byte sizes. 150 // Byte sizes.
151 const int kWordSize = sizeof(word); 151 const int kWordSize = sizeof(word);
152 #ifdef ARCH_IS_32_BIT 152 #ifdef ARCH_IS_32_BIT
153 const int kWordSizeLog2 = 2; 153 const int kWordSizeLog2 = 2;
154 const uword kUwordMax = kMaxUint32;
154 #else 155 #else
155 const int kWordSizeLog2 = 3; 156 const int kWordSizeLog2 = 3;
157 const uword kUwordMax = kMaxUint64;
156 #endif 158 #endif
157 159
158 // Bit sizes. 160 // Bit sizes.
159 const int kBitsPerByte = 8; 161 const int kBitsPerByte = 8;
160 const int kBitsPerByteLog2 = 3; 162 const int kBitsPerByteLog2 = 3;
161 const int kBitsPerWord = kWordSize * kBitsPerByte; 163 const int kBitsPerWord = kWordSize * kBitsPerByte;
162 164
163 // System-wide named constants. 165 // System-wide named constants.
164 const int KB = 1024; 166 const int KB = 1024;
165 const int MB = KB * KB; 167 const int MB = KB * KB;
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 // separate lines with body in {}s). 339 // separate lines with body in {}s).
338 # define TEMP_FAILURE_RETRY(expression) \ 340 # define TEMP_FAILURE_RETRY(expression) \
339 ({ int64_t __result; \ 341 ({ int64_t __result; \
340 do { \ 342 do { \
341 __result = (int64_t) (expression); \ 343 __result = (int64_t) (expression); \
342 } while (__result == -1L && errno == EINTR); \ 344 } while (__result == -1L && errno == EINTR); \
343 __result; }) 345 __result; })
344 #endif 346 #endif
345 347
346 #endif // PLATFORM_GLOBALS_H_ 348 #endif // PLATFORM_GLOBALS_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/debugger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698