blob: 2f852701cb598dce32719fa708b80e6535b42937 [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
8namespace android {
9namespace runtime {
10
11typedef uint8_t byte;
12typedef intptr_t word;
13typedef uintptr_t uword;
14
15const int KB = 1024;
16const int MB = KB * KB;
17const int GB = KB * KB * KB;
18const int kMaxInt = 0x7FFFFFFF;
19const int kMinInt = -kMaxInt - 1;
20
21const int kCharSize = sizeof(char);
22const int kShortSize = sizeof(short);
23const int kIntSize = sizeof(int);
24const int kDoubleSize = sizeof(double);
25const int kIntptrSize = sizeof(intptr_t);
26const int kWordSize = sizeof(word);
27const int kPointerSize = sizeof(void*);
28
29const int kBitsPerByte = 8;
30const int kBitsPerByteLog2 = 3;
31const int kBitsPerPointer = kPointerSize * kBitsPerByte;
32const int kBitsPerWord = kWordSize * kBitsPerWord;
33const int kBitsPerInt = kIntSize * kBitsPerByte;
34
35} } // namespace android::runtime
36
37#endif // ART_SRC_GLOBALS_H_