diff options
author | Sven Gothel <[email protected]> | 2012-06-18 18:21:15 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-06-18 18:21:15 +0200 |
commit | 05024570dbf5fce08fa8ff081cb696f0fc4b7f95 (patch) | |
tree | 2d5ac237803252a7490805c35e211daebe07381b /src/java/jogamp/common/os/MachineDescriptionRuntime.java | |
parent | 1468286bf569a493e4fdb887d5f3732f88c8cec3 (diff) |
Fix Platform static initialization interdependencies w/ GlueGen native library loading
Some Platform field declarations and it's static initialization has been delegated
to it's new abstract super class PlatformPropsImpl to solve
static initialization interdependencies w/ the GlueGen native library loading
and it's derived information {@link #getMachineDescription()}, {@link #is32Bit()}, ..<br>
This mechanism is preferred in this case to avoid synchronization and locking
and allow better performance accessing the mentioned fields/methods.
Diffstat (limited to 'src/java/jogamp/common/os/MachineDescriptionRuntime.java')
-rw-r--r-- | src/java/jogamp/common/os/MachineDescriptionRuntime.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/java/jogamp/common/os/MachineDescriptionRuntime.java b/src/java/jogamp/common/os/MachineDescriptionRuntime.java index 3a89395..8b38b25 100644 --- a/src/java/jogamp/common/os/MachineDescriptionRuntime.java +++ b/src/java/jogamp/common/os/MachineDescriptionRuntime.java @@ -53,7 +53,7 @@ public class MachineDescriptionRuntime { } private static boolean isCPUArch32Bit() throws RuntimeException { - switch( Platform.CPU_ARCH ) { + switch( PlatformPropsImpl.CPU_ARCH ) { case X86_32: case ARM: case ARMv5: @@ -68,22 +68,22 @@ public class MachineDescriptionRuntime { case PA_RISC2_0: return false; default: - throw new RuntimeException("Please port CPU detection (32/64 bit) to your platform (" + Platform.OS_lower + "/" + Platform.ARCH_lower + "("+Platform.CPU_ARCH+"))"); + throw new RuntimeException("Please port CPU detection (32/64 bit) to your platform (" + PlatformPropsImpl.OS_lower + "/" + PlatformPropsImpl.ARCH_lower + "("+PlatformPropsImpl.CPU_ARCH+"))"); } } private static MachineDescription.StaticConfig getStaticImpl() { if(isCPUArch32Bit()) { - if(Platform.getCPUFamily() == Platform.CPUFamily.ARM && Platform.isLittleEndian()) { + if(PlatformPropsImpl.CPU_ARCH.getFamily() == Platform.CPUFamily.ARM && PlatformPropsImpl.LITTLE_ENDIAN) { return StaticConfig.ARMle_EABI; - } else if(Platform.getOSType() == Platform.OSType.WINDOWS) { + } else if(PlatformPropsImpl.OS_TYPE == Platform.OSType.WINDOWS) { return StaticConfig.X86_32_WINDOWS; - } else if(Platform.getOSType() == Platform.OSType.MACOS) { + } else if(PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS) { return StaticConfig.X86_32_MACOS; } return StaticConfig.X86_32_UNIX; } else { - if(Platform.getOSType() == Platform.OSType.WINDOWS) { + if(PlatformPropsImpl.OS_TYPE == Platform.OSType.WINDOWS) { return StaticConfig.X86_64_WINDOWS; } return StaticConfig.X86_64_UNIX; @@ -128,7 +128,7 @@ public class MachineDescriptionRuntime { // size: int, long, float, double, pointer, pageSize // alignment: int8, int16, int32, int64, int, long, float, double, pointer return new MachineDescription( - true /* runtime validated */, Platform.isLittleEndian(), + true /* runtime validated */, PlatformPropsImpl.LITTLE_ENDIAN, getSizeOfIntImpl(), getSizeOfLongImpl(), getSizeOfFloatImpl(), getSizeOfDoubleImpl(), getSizeOfLongDoubleImpl(), |