00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 # include "incls/_precompiled.incl"
00026 # include "incls/_spaceSize.cpp.incl"
00027
00028 static int scale_and_adjust(int value) {
00029 int result = roundTo(value * K, Universe::page_size());
00030 return result;
00031 }
00032
00033 void spaceSizes::initialize() {
00034 reserved_object_size = scale_and_adjust(ReservedHeapSize);
00035 eden_size = scale_and_adjust(EdenSize);
00036 surv_size = scale_and_adjust(SurvivorSize);
00037 old_size = scale_and_adjust(OldSize);
00038
00039 reserved_codes_size = scale_and_adjust(ReservedCodeSize);
00040 code_size = scale_and_adjust(CodeSize);
00041
00042 reserved_pic_heap_size = scale_and_adjust(ReservedPICSize);
00043 pic_heap_size = scale_and_adjust(PICSize);
00044
00045 jump_table_size = JumpTableSize;
00046 }
00047
00048 #ifdef unused_but_maybe_useful_later
00049
00050 static int GetNumericEnvironmentVariable(char* name, int factor, int def) {
00051 char* n = getenv(name);
00052 if (n) {
00053 int l = def;
00054 if (sscanf(n, "%ld", &l) == 1) {
00055 def = l * factor;
00056 } else {
00057 warning("%s environment variable isn't a number", name);
00058 }
00059 }
00060 return def;
00061 }
00062
00063 static int getSize(char* name, int def) {
00064 const int blockSize = 4 * K;
00065 int size = GetNumericEnvironmentVariable(name, 1024, def);
00066 return roundTo(size, blockSize);
00067 }
00068
00069 static int getSize(int def) {
00070 const int blockSize = 4 * K;
00071 return roundTo(def, blockSize);
00072 }
00073
00074 #endif
00075