blob: 92d0cf72b546f35bf650882f9595c8bb2bd65a38 [file] [log] [blame]
Carl Shapiroa5d5cfd2011-06-21 12:46:59 -07001// Copyright 2011 Google Inc. All Rights Reserved.
2
3#ifndef ART_SRC_GLOBALS_H_
4#define ART_SRC_GLOBALS_H_
5
6#include <stdint.h>
7
Carl Shapiro6b6b5f02011-06-21 15:05:09 -07008namespace art {
Carl Shapiroa5d5cfd2011-06-21 12:46:59 -07009
10typedef uint8_t byte;
11typedef intptr_t word;
12typedef uintptr_t uword;
13
14const int KB = 1024;
15const int MB = KB * KB;
16const int GB = KB * KB * KB;
17const int kMaxInt = 0x7FFFFFFF;
18const int kMinInt = -kMaxInt - 1;
19
20const int kCharSize = sizeof(char);
21const int kShortSize = sizeof(short);
22const int kIntSize = sizeof(int);
23const int kDoubleSize = sizeof(double);
24const int kIntptrSize = sizeof(intptr_t);
25const int kWordSize = sizeof(word);
26const int kPointerSize = sizeof(void*);
27
28const int kBitsPerByte = 8;
29const int kBitsPerByteLog2 = 3;
30const int kBitsPerPointer = kPointerSize * kBitsPerByte;
31const int kBitsPerWord = kWordSize * kBitsPerWord;
32const int kBitsPerInt = kIntSize * kBitsPerByte;
33
Carl Shapiro6b6b5f02011-06-21 15:05:09 -070034} // namespace art
Carl Shapiroa5d5cfd2011-06-21 12:46:59 -070035
36#endif // ART_SRC_GLOBALS_H_