blob: 2826bbd9eeae56884d2e679184541e16b911c15f [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
Carl Shapiro69759ea2011-07-21 18:13:35 -070015const size_t KB = 1024;
16const size_t MB = KB * KB;
17const size_t GB = KB * KB * KB;
Carl Shapiroa5d5cfd2011-06-21 12:46:59 -070018const 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
Brian Carlstromb0460ea2011-07-29 10:08:05 -070035const int kPageSize = 4096;
36
Carl Shapiro6b6b5f02011-06-21 15:05:09 -070037} // namespace art
Carl Shapiroa5d5cfd2011-06-21 12:46:59 -070038
39#endif // ART_SRC_GLOBALS_H_