| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
util. ValueConv for primitive type value conversion
|
| |
|
| |
|
|
|
|
| |
start, otherwise we may collide w/ a failed start. Misc: Cleanup / reuse strings.
|
|
|
|
|
|
|
|
| |
- LockExt -> ThreadLock - clarifying semantics (API Change)
- ThreadLock: Remove isOwner(), use isOwner(Thread.currentThread)
- adding @Override
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Derivation
+++
JNILibLoaderBase.addNativeJarLibs(..): Add API doc
JNILibLoaderBase:
"addNativeJarLibs(Class<?> classFromJavaJar, String allNativeJarBaseName, String[] atomicNativeJarBaseNames)" ->
"addNativeJarLibs(Class<?>[] classesFromJavaJars, String singleJarMarker, String[] stripBasenameSuffixes)"
Derive the 'all' (1st choice) native JAR URL solely on the given class's JAR URL.
Examples:
JOCL:
// only: jocl.jar -> jocl-natives-'os.and.arch'.jar
addNativeJarLibs(new Class<?>[] { JOCLJNILibLoader.class }, null, null );
JOGL:
final ClassLoader cl = GLProfile.class.getClassLoader();
// either: [jogl-all.jar, jogl-all-noawt.jar, jogl-all-mobile.jar] -> jogl-all-natives-<os.and.arch>.jar
// or: nativewindow-core.jar -> nativewindow-natives-<os.and.arch>.jar,
// jogl-core.jar -> jogl-natives-<os.and.arch>.jar,
// (newt-core.jar -> newt-natives-<os.and.arch>.jar)? (if available)
final String newtFactoryClassName = "com.jogamp.newt.NewtFactory";
final Class<?>[] classesFromJavaJars = new Class<?>[] { NWJNILibLoader.class, GLProfile.class, null };
if( ReflectionUtil.isClassAvailable(newtFactoryClassName, cl) ) {
classesFromJavaJars[2] = ReflectionUtil.getClass(newtFactoryClassName, false, cl);
}
JNILibLoaderBase.addNativeJarLibs(classesFromJavaJars, "-all", new String[] { "-noawt", "-mobile", "-core" } );
Efficiency / Performance:
- Reduced JAR URL lookup calls JarUtil.getJarURL(..) - JNILibLoaderBase, Platform, JarUtil
- Attempt loading Jar files (native, class, ..) only once - TempJarCache
Code Cleanup (IOUtil, JarUtil, :
- IOException if not found
- IllegalArgumentException if null argument
+++
jogamp.android-launcher.jar -> jogamp-android-launcher.jar
+++
|
|
|
|
|
|
|
|
|
|
|
| |
tool native libraries.
NativeLibrary: Expose 'String findLibrary(String libName, ClassLoader loader)',
allowing utilization of System.load(loader.findLibrary(libName)).
JNILibLoaderBase.loadLibrary(): Add optional ClassLoader argument, used to locate the library
DynamicLibraryBundle: Use DynamicLibraryInfo's ClassLoader to find native libraries (tool + jni)
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'android-armv7hf' and 'linux-armv7hf' ]
- Platform gets new ABIType [ GENERIC, ARMEL, ARMHF ]
- Platform impl. needs to guess ABIType in case of ARM,
since no Java system property ('os.arch' ..) reflects the new EABI.
I consider this a bug, since this will also hinder JNLP to work.
The latter also uses 'os.arch' sys property to determine the nativelib resource!
(See Platform.guessABITypeImpl(..) for details how we guess the type.)
- Adding symbolic links to ubuntu's gnueabihf cross tool chain
- Adding armhf crossbuild script
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Fix 'NIOOnly' impl
- Use 'final' in gen. Java stubs ;
- No null check for Buffers.isDirect(arrayArg) [required]
- Clarify Buffer arg API doc (NIOOnly or NIODirectOnly)
- cleaned up loop / branch (CMethodBindingEmitter)
- remove unsued vars/code
- Tests:
- covers normal/NIOOnly/NIODirectOnly
- covers passing null for array and NIO
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Android ClassLoaderUtil cleanup;
- Add 'asset' URLConnection
- Please read API doc 'PiggybackURLConnection' and 'AssetURLConnection'
- Solves generic resource handling where platform locations may differ,
ie ClassLoader lookup on Android in the 'assets/' subfolder.
- New Android 'AssetDexClassLoader' uses 'assets/' folder for findResource(..)
- aapt.signed (our APK ant task)
- uses 'assets/' folder
- adds the 'assetsdir' attribute allowing to copy other assets into the APK
- IOUtil uses URLConnection / incr. effeciency
- using URLConnection on all getResource(..) since URL
is connected anyways for validation and URLConnection can be used by caller right away
- String getRelativeOf(URL, String) -> URL getRelativeOf(URL, String)
- preserves scheme, authority, etc
- simple parentOf handling, more efficient
- reusing new 'asset' protocol impl.
- Android ClassLoaderUtil cleanup;
- Use createClassLoader(..) impl for build-in static jogamp and user APKs,
which removes code redundancy
Tests: New code path, especially 'assets' are covered by new unit tests, no regressions on Linux.
|
|
|
|
| |
close within the latter
|
|
|
|
|
|
| |
-> JarURL on Android
All [remaining] tests passed on Android!
|
|
|
|
| |
most of tests in TestJarUtil
|
|
|
|
|
|
|
|
|
| |
conversion, ie. 32/64 bits)
An opaque type still needs to be converted to the right size (32/64 bit).
In case of a conversion, respect the pointer type.
This fixes bug 536 .
|
|
|
|
|
|
|
|
|
|
|
|
| |
'spawn off' process to become the lock owner.
To avoid complicated synchronization via synchronized, wait and notify between one thread
and a 'spawn' off thread which temporarly requires the hold lock,
RecursiveThreadGroupLock allows to add and remove other threads to become owners of the lock
as if they were the original holder.
This simplifies some rare locking use cases, eg. in JOGL's GLProfile initialization sequence
where a SharedResourceRunner thread is taking over initialization of shared resources.
|
| |
|
| |
|
|
|
|
| |
our lifecycle. JarFile's hash almost always differs.
|
| |
|
|
|
|
|
|
|
|
| |
Add unit test.
Misc.:
- IOUtil: Add toURL* methods
- TempJarCache: Add 'URL getResource(String)'
|
|
|
|
| |
43b7675259eb76c570b6cc3a44fec2b9f6410697)
|
|
|
|
| |
ReflectionUtil.MethodAccess, a convenient Method instance accessor.
|
|
|
|
| |
exceptions
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
const, ie no write-back
We shall consider the C header declaration as being correct
and no modification shall happen on const arrays.
Tested w/ unit tests and JOGL
+++
Cleanup JavaType: final immutable fields, proper CVoidPointer name
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- RecursiveLock _is_ interface.
- Use LockFactory to create a RecursiveLock.
- Impl: RecursiveLockImpl01Unfairish
- just using notify w/o any queue: fast
- still enqueuing new lock-applicants if queue full (nice)
- lock's sync extends AbstractOwnableSynchronizer and uses it (monitor)
- Impl: RecursiveLockImpl01CompleteFair
- using queue and interrupt for correctness (slow)
- lock's sync extends AbstractOwnableSynchronizer and uses it (monitor)
- Impl: RecursiveLockImplJava5 for using Java5's concurrency impl.
- to verify correctness, performance and deviation of locking time
TestRecursiveLock01 new performance measurements incl. simple avrg and deviation
shows best combined performance-deviation w/ our RecursiveLockImpl01Unfairish
os Linux and MacOSX.
RecursiveLockImpl01Unfairish is the default in LockFactory.
Adding 'private' LockDebugUtil, allowing validating all holdings locks
of one thread as stack traces (Throwable).
Besides the AbstractOwnableSynchronizer utilization, this helps debugging deadlocks
and starvation very well.
|
|
|
|
| |
Certificates if caller has any. Add Convenient JNILibLoaderBase.addNativeJarLibs(..) method.
|
|
|
|
|
|
|
|
| |
gluegen-rt native lib as well
- removed redundance
- move proper JNLPAppletLauncher custom libloader code into JNILibLoaderBase
- prepares for new JAR temp cache ..
|
|
|
|
| |
initialization/usage only
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
JarUtil:
Utility to handle Jar files and it's content, incl. extracting it's entries
TempFileCache:
Utility to have a save temporary file cache per JVM and per instance,
eg. per ClassLoader.
The temp cache is cleaned up with the next usage of TempFileCache,
which solves the troubles of JVM bugs and situations where the JVM
is not able to close and delete open temp files.
TempJarCache:
Utility to cache Jar files temporary (using TempFileCache)
and access it's content.
This class is suitable to implement a URLClassLoader
or similar resource loading facilities.
All tested w/ TestTempJarCache
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
- junit.cross targets:
- use scripting to save time, ie write all target commands to script, xfer, exec
- junit: delete result folder just before junit.run
- Test BuildEnvironment.java: Simplify path config via properties (for android)
- AndroidVersion: No annoying exception dump if Build$VERSION* is not found (not android)
- launch scripts: use absolute TARGET_ROOT path for dynamic linker env.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test1p2ProcAddressEmitter
Fix Test1p2ProcAddressEmitter
- 3 tests used the wrong binding instance,
where no native lib was loaded for - duh :)
Cleaned up android build
- add unix src (UnixDynamicLinkerImpl_JNI.c)
- remove linker cmds in compile arguments
Cross junit/java android test works via script
- target command scrip is written to file, pushed and executed
Status: com.jogamp.gluegen.test.junit.generation.Test1p2ProcAddressEmitter
- passed
- on par w/ linux-armv7
|
|
|
|
| |
speedup test
|
|
|
|
|
|
|
|
|
|
|
|
| |
- StructAccessor uses byteOffset now (since 8b3057585930357bb16546f584d998953b084034)
Fix linux armv7l eabi:
- build.xml arm7 -> armv7
- all tests passes
Adding NativeSizeAlignment-linux-armv7l_eabi from passing test
OK: linux 32/64/armv7l, windows 32/64
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Fin
MachineDesction == MD
MD.StaticConfig:
- enum for all supported static configs (ID -> MD)
- verified at runtime: test runtime queried-MD versus static-MD,
hard fail if not compatible (size/alignment)
SizeThunk primitive sizes:
- Add notion of fixed native size (eg. int64_t) and otherwise (eg. long)
java struct 'wrappers' code generation:
- single class using size/offset arrays of all MachineDescription configurations
- at runtime the array idx is queried in static block
- type aligment for not fixed-native-size types (SizeThunk, undef long/int) via StructAccessor
junit test:
- add float test
- fix native code
- add java (create, write) -> native (verify) test
works (tested) on: linux 32/64 and windows 32/64
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Platform:
- enum CPUFamily is part of CPUType
- DALVIK -> ANDROID
- ARM: ARM + ARMv[567]
MachineDescription
- self contained
- static size/alignment Config (enum) for unix32, unix64, win32, win64 and armeabi
- add 'long double'
- Removed MachineDescription32Bit, MachineDescription64Bit
- createStatic(..) uses OS/CPU to fetch best match if not at runtime
FIXES: JavaEmitter's struct-emit: Proper 32/64 struct sizes
TODO: StructAccessor's mapping to <Type>Buffer w/ index os sizeof(<Type>)
doesn't work, since offset may not be multiple of sizeof(<Type>)!
i.e.
typedef struct {
int8_t bits1; // +1 - 0
// +3 (p32)
int32_t id; // +4 - 4
int8_t bits2; // +1 - 8
// +3 (p32) -
int64_t long0; // +8 - 12
so "longBuffer.get(<type-sized index>)" is invalid,
but "byteBuffer.getLong(<byte index>)" must be done.
The actual impl. doesn't matter, hence dropping the other nio type mappings is good.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
com.jogamp.gluegen.cgram.types -> com.jogamp.gluegen.runtime.types
This is required for desired runtime memory layout.
- Split CompoundType to StructType + UnionType
- StructLayout:
- Utilizing SizeThunk alignment
- Alignment
1) Natural type alignment
2) Add Size
3) Trailing padding w/ largest element alignment
- Only perform memory layout once for type.
Status:
- Unit test passes w/ static MachineDescriptor64Bit
- FIXME static 32bit is faulty, uses 64bit size/alignment
- TODO runtime struct layout to please all platforms w/o worrying
|
|
|
|
| |
low performance ARM
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Preparation.
Currently GlueGen fails for type long (size) and some alignments (see package.html).
- The size and alignment values shall be queried at runtime.
- Compound alignment needs to follow the described natural alignment (also @runtime).
-
- Build
- add Linux Arm7 (EABI)
- junit test
- added compound/struct tests, pointing out the shortcomings of current impl.
- package.html
- Added alignment documentation
- remove intptr.cfg
- add GluGen types int8_t, int16_t, uint8_t, uint16_t
- move MachineDescription* into runtime
- Platform
- has runtime MachineDescription
- moved size, .. to MachineDescription
- use enums for OSType, CPUArch and CPUType defined by os.name/os.arch,
triggering exception if os/arch is not supported.
This avoids Java String comparison and conscious os/arch detection.
- MachineDescription:
- compile time instances MachineDescription32Bits, MachineDescription64Bits
- runtime queried instance MachineDescriptionRuntime
- correct size, alignment, page size, ..
|
| |
|
|
|
|
| |
Compile posted Issue* Bug* snippets
|
|
|
|
|
|
|
|
|
|
|
| |
BeforeClass/AfterClass FileLock
Due to the fact that any test with a UI may interfere
with a UI test (test focus, active, ..), all tests are
derived from the common UITestCase superclass, which
decorates the test class with a FileLock at BeforeClass/AfterClass.
Increased junit timeout to 10 min
|
|
|
|
| |
otherwise multiple parallel tests will render the result invalid
|
|
|
|
| |
IOUtil and Platform's page size
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
alloc referenced data map if used only)
This patch doesn't impact GlueGen's code generation,
but enhance and fix PointerBuffer usage only.
remove explicit backup array
As suggested by Michael Bien with a proposed patch,
PointerBuffer's backup array is not only redundant in case it's not used,
but also erroneous - due to possible sliced buffers.
Removes the explicit backup array implementation
leaving it up to the user, ie how PointerBuffer is created (alloc/allocDirect)
and use the underlying nio's buffer backup array, if available.
This also fixes the (never tested) case of indirect w/ backup array usage
on 32bit platform size. In this case the array shall be of type int[],
holding 32bit pointer - on 64bit long[].
Previous to this patch, it was always long[].
Added more thorough tests of PointerBuffer, notably indirect w/ backup array
and native deep copy and filling of a pointer array.
alloc referenced data map if used only
As suggested by Michael Bien with a proposed patch,
the allocation of the dataMap hash map is redundant in case it's not used.
The hash map will be initialized lazy, if needed only.
|
|
|
|
|
|
| |
- removed Int64Buffer since it is no longer needed for LongBuffer emulation
Signed-off-by: Sven Gothel <[email protected]>
|
|
|
|
| |
values (using equals(Object)); Adding junit tests for clone(), capacity and IntObjectHashMap
|