38 static volatile boolean initialized =
false;
50 if(
null == staticMD ) {
51 throw new RuntimeException(
"No compatible MachineDataInfo.StaticConfig for runtime:"+
PlatformProps.
NEWLINE+runtimeMD);
53 if( !staticMD.md.compatible(runtimeMD) ) {
56 " Runtime "+runtimeMD);
58 MachineDataInfoRuntime.runtimeMD = runtimeMD;
59 MachineDataInfoRuntime.staticMD = staticMD;
64 " Runtime "+runtimeMD);
70 throw new InternalError(
"Already initialized");
81 throw new InternalError(
"Not set");
91 throw new InternalError(
"Not set");
101 }
catch (
final Throwable err) {
105 final int pointerSizeInBytes = getPointerSizeInBytesImpl();
106 switch(pointerSizeInBytes) {
111 throw new RuntimeException(
"Unsupported pointer size "+pointerSizeInBytes+
"bytes, please implement.");
114 final long pageSizeL = getPageSizeInBytesImpl();
115 if(Integer.MAX_VALUE < pageSizeL) {
116 throw new InternalError(
"PageSize exceeds integer value: " + pageSizeL);
121 return new MachineDataInfo(
124 getSizeOfIntImpl(), getSizeOfLongImpl(),
125 getSizeOfFloatImpl(), getSizeOfDoubleImpl(), getSizeOfLongDoubleImpl(),
126 pointerSizeInBytes, (
int)pageSizeL,
128 getAlignmentInt8Impl(), getAlignmentInt16Impl(), getAlignmentInt32Impl(), getAlignmentInt64Impl(),
129 getAlignmentIntImpl(), getAlignmentLongImpl(),
130 getAlignmentFloatImpl(), getAlignmentDoubleImpl(), getAlignmentLongDoubleImpl(),
131 getAlignmentPointerImpl());
134 private static native
int getPointerSizeInBytesImpl();
135 private static native
long getPageSizeInBytesImpl();
137 private static native
int getAlignmentInt8Impl();
138 private static native
int getAlignmentInt16Impl();
139 private static native
int getAlignmentInt32Impl();
140 private static native
int getAlignmentInt64Impl();
141 private static native
int getAlignmentIntImpl();
142 private static native
int getAlignmentLongImpl();
143 private static native
int getAlignmentPointerImpl();
144 private static native
int getAlignmentFloatImpl();
145 private static native
int getAlignmentDoubleImpl();
146 private static native
int getAlignmentLongDoubleImpl();
147 private static native
int getSizeOfIntImpl();
148 private static native
int getSizeOfLongImpl();
149 private static native
int getSizeOfPointerImpl();
150 private static native
int getSizeOfFloatImpl();
151 private static native
int getSizeOfDoubleImpl();
152 private static native
int getSizeOfLongDoubleImpl();