blob: 73afb7c98d8f64f0711d9575d69fe6ddc8c6b182 [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
Carl Shapiro1fb86202011-06-27 17:43:13 -07006#include <stddef.h>
Carl Shapiroa5d5cfd2011-06-21 12:46:59 -07007#include <stdint.h>
8
Carl Shapiro6b6b5f02011-06-21 15:05:09 -07009namespace art {
Carl Shapiroa5d5cfd2011-06-21 12:46:59 -070010
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;
Carl Shapiro0e5d75d2011-07-06 18:28:37 -070032const int kBitsPerWord = kWordSize * kBitsPerByte;
Carl Shapiroa5d5cfd2011-06-21 12:46:59 -070033const int kBitsPerInt = kIntSize * kBitsPerByte;
34
Carl Shapiro6b6b5f02011-06-21 15:05:09 -070035} // namespace art
Carl Shapiroa5d5cfd2011-06-21 12:46:59 -070036
37#endif // ART_SRC_GLOBALS_H_