| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
interfaces, TODO implementation
Note: JavaCallbackDef is commented out on test2.cfg example, since implementation is missing.
|
|
|
|
| |
See documentation and unit test test2.h, Test2FuncPtr.java and Test3PtrStorage.java
|
| |
|
| |
|
|
|
|
| |
get<FuncName>()
|
|
|
|
| |
documentation
|
| |
|
|
|
|
| |
Add emitCustomJNICode(..) for JavaEmitter.endFunctions() not just structs and fix the JNI-c stub code
|
|\ |
|
| | |
|
|\ \ |
|
| |/ |
|
|\ \ |
|
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
eec3f21c3597ff9bf9760a06e00dd341214ea90d
See impact to T2_InitializeOptions struct fields:
- 'void* Reserved1' shall be ignored (*this is the regression fix*)
- 'void* Reserved2' will be taked due to config 'Opaque long T2_InitializeOptions.Reserved2'
- 'T2_CustomFunc CustomFunc2' will produce a member function call as previously
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
flag), added (detailed) JavaDoc in generated code
Revised setter:
A) int32_t val[10] -> setter for a subset change only, as-is with args[src, srcPos, destPos, length]
- no new memory, reuse only
- no special action to be performed
B) int32_t* val -> setter with toggle 'subset' with args[subset, src, srcPos, destPos, length],
- replace memory w/ 'subset==false' where it also may copy 'destPos' gap from old -> new
- reuse memory w/ 'subset==true', where destPos+length <= elementCount
C) const int32_t* val -> setter to replace referenced memory only args[src, srcPos, length]
- always replaces memory, no copy of a gap (no destPos)
Hence:
- case (A) stays as is
- case (B) will be revised and argument 'boolean subset' added
- case (C) will be revised (simplified) and argument 'destPos' removed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GlueGen Revised Struct Mapping (esp pointer to array or single element), Struct String Charset, .. and Documentation
- Documentation:
- Added README.md
Let's have a proper face for the git repo
- Added doc/GlueGen_Mapping.md (and its html conversion doc/GlueGen_Mapping.html)
Created a new document covering application and implementation details suitable for users/devs.
- Added doc/JogAmpMacOSVersions.md conversion to doc/JogAmpMacOSVersions.html
- Updated www/index.html
- Use *CodeUnit instead of PrintWriter, representing a Java or C code unit covering a set of functions and structs.
The CCodeUnit also handles common code shared by its unit across functions etc.
- Dropping 'static initializer', as its no more required
due to simplified `JVMUtil_NewDirectByteBufferCopy()` variant.
- Revised Struct Mapping:
- Pure Java implementation to map primitive and struct fields within a struct
by utilizing ElementBuffer.
Only 'Function Pointer' fields within a struct require native code.
Exposes `static boolean usesNativeCode()` to query whether native code is used/required.
- Transparent native memory address API
Expose `long getDirectBufferAddress()` and `static TK_Struct derefPointer(long addr)`,
allowing to
- pass the native struct-pointer with native code
- reconstruct the struct from a native struct-pointer
- have a fully functional `TK_Struct.derefPointer(struct.getDirectBufferAddress())` cycle.
- Add 'boolean is<Val>Null() to query whether a pointer (array) is NULL
- *Changed* array get/set method for more flexibility alike `System.arraycopy(src, srcPos, dest, destPos, len)`,
where 'src' is being dropped for the getter and 'dest' is being dropped for the setter
as both objects are reflected by the struct instance.
- *Changed* `get<Val>ArrayLength()` -> `get<Val>ElemCount()` for clarity
- Considering all ConstElemCount values with config 'ReturnedArrayLength <int>'
to be owned by native code -> NativeOwnership -> Not changing the underlying memory region!
JavaOwnership is considered for all pointer-arrays not of NativeOwnership.
Hence any setter on a NativeOwnership pointer-array will fail with non-matching elem-count.
- Add 'release<Val>()' for JavaOwnership pointer-arrays,
allowing to release the Java owned native memory incl. null-ing pointer and set<Val>ElemCount(0).
- Support setter for 'const <type>*' w/ JavaOwnership, i.e. pointer to const value of a primitive or struct,
setter and getter using pointer to array or single element in general.
- Added Config `ImmutableAccess symbol` to disable all setter for whole struct or a field
- Added Config `MaxOneElement symbol` to restrict a pointer to maximum one element and unset
initial value (zero elements)
- Added Config `ReturnsStringOnly symbol` to restrict mapping only to a Java String,
dropping the ByteBuffer variant for 'char'
- String mapping default is UTF-8 and can be read and set via [get|set]Charset(..) per class.
- Dynamic string length retrieval in case no `ReturnedArrayLength` has been configured
has changed from `strlen()` to `strnlen(aptr, max_len)` to be on the safe site.
The maximum length default is 8192 bytes and can be read and set via [get|set]MaxStrnlen(..) per class.
FIXME: strnlen(..) using EOS byte non-functional for non 8-bit codecs like UTF-8, US-ASCII.
This is due to e.g. UTF-16 doesn't use an EOS byte, but interprets it as part of a code point.
- TODO: Perhaps a few more unit tests
- TODO: Allow plain 'int' to be mapped in structs IFF their size is same for all MachineDescriptions used.
Currently this is the case -> 4 bytes like int32_t.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
native-free-code Struct-Code generation
Recfactored all NIO buffer utils to Buffers, i.e. buffer <-> address, memcpy, strnlen, etc
Buffers:
- Added copyNativeToDirectByteBuffer(..), allowing to copy a native memory slice into a direct buffer.
- Added typeNameToBufferClass(String) and sizeOfBufferElem(Class<? extends Buffer>)
- Completed slize2<Type>(..) buffer-mapping methods
- Exposure of safe getDirectByteBuffer(..) w/ null-check (package private)
Added NativeBuffer.storeDirectAddress(..), allowing to write the array address into a native buffer (struct, etc),
allowing to referencing the ElementBuffer (linear array of elements) and PointerBuffer (array of pointer).
Hint: This can be read via PointerBuffer.wrap(..).get(0)
Added ElementBuffer (a NativeBuffer) mapping an array of elements,
completing native abstraction next to PointerBuffer (array of pointer).
ElementBuffer can dereference an existing element-array by native address via ElementBuffer.derefPointer(..).
Views of its content can be directly accessed via ElementBuffer.slice(..).
+++
These utilities and buffer abstractions will allow to reuse code and simplify the GlueGen struct get/set implementations
and help to reduce native code injection.
|
|
|
|
|
|
|
|
|
|
| |
(segment) of the input stream (skipBytes, byteCount)
This method is inspired by Bug 1280, <https://github.com/sgothel/joal/pull/16>,
'copy only needed bytes' for JOAL's com.jogamp.openal.util.WAVData.loadFromStream(..).
This method is a revised version of the proposed IOHelpers.copyFromStream2ByteBuffer(..),
see <https://github.com/OndrejSpanel/joal/commit/1616659e98904270af4faca25b770d0983609735>
|
|
|
|
| |
'totalNumBytes' argument, since we have no user-feedback callback passed.
|
| |
|
| |
|
|
|
|
| |
'const' qualifier
|
|
|
|
| |
'yield_thread()' to avoid potential Java>17 collision (JEP 361)
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Test1p1Test1p1JavaEmitter
'com.jogamp.gluegen.test.junit.generation.Test1p1JavaEmitter' exposes a regression
using MingW64 8.1.0: System.loadLibrary() gives a "Can't find dependent libraries".
Here, 'Bindingtest1p1' is linked against 'test1' and fails to load
due to its wrong dependent library name within 'Bindingtest1p1'.
MingW64 8.1.0 dropped 'libtest1.so' into 'Bindingtest1p1.dll',
which is surely wrong. Even passing '-Wl,-soname=test1.dll' didn't help.
Note: Such constellation would only work with adding
the lib-path to PATH on Windows.
Since we don't utilize the method in any of our projects,
but use the dynamic library lookup method - this is not a blocker,
but wasted some good time.
|
|
|
|
|
|
|
|
|
|
|
| |
As of Java9, sun.misc.Cleaner has moved to jdk.internal.ref.Cleaner.
However, access has been made (under the table) via sun.misc.Unsafe,
which we are using for now as we cannot set the jdk.internal.ref.Cleaner method accessible.
In this regard, we had to change our Cleaner.clean(..) method using a ByteBuffer
instead of a Buffer object paramter.
All tests have passed, no more illegal access case running on Java11 has been exposed.
|
|
|
|
|
|
|
|
|
|
| |
gluegen-rt -> gluegen_rt
- Fix finding native library for Elf parsing
- Fix one unit test
- Fix comments
Completes commit 330dad069dee5a0cc0480cf5cd9052000004223a
|
|
|
|
|
|
|
|
|
| |
When annotations were placed on dummy Java variables, the annotation
processor was emitting a RenameJavaType directive into the gluegen
config file that caused the emitted file to be named boolean.java
instead of RenderingConfig.java or Pixel.java. Turned off this behavior
when jname is given in the @CStruct annotation. I'm uncertain how much
this processor is even used, since I can't find any occurrences of
@CStruct outside the test code for it in gluegen.
|
|
|
|
|
| |
Implementation currently uses 256 bit Secure Hash (SHA) algorithm, but this may change in the future.
Hence only use 'SHA' in the names, not 'SHA256'.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
runtime validation
This change implements a strong SHA256 signature over:
1) source tree inclusive make recipe (SHA256-Source)
2) all class files (SHA256-Classes)
3) all native libraries (SHA256-Natives)
4) the class files as deployed in the jar (SHA256-Classes-this)
5) the native libraries as deployed in the jar (SHA256-Natives-this)
and drops all of these in the deployed Jar file.
This allows SHA256 validation of (4) + (5) at runtime
and further complete validation (1), (2) and (3) offline.
Full SCC would now required (1) - (3) to be placed on a server for further validation.
Optionally we may use GPG <https://gnupg.org/> or PGP to validate the build entity to implement the chain of trust <https://en.wikipedia.org/wiki/Chain_of_trust>
The SHA256 runtime validation is tested via: com.jogamp.common.util.TestVersionInfo
|
|
|
|
| |
executables
|
|
|
|
| |
for System related Operations
|
|
|
|
|
|
|
|
|
|
|
| |
and 'searchSystemPathFirst' attributes
NativeLibrary can be instantiate by defining
'searchSystemPath' and 'searchSystemPathFirst' arguments,
allowing to specify the system path role while looking up the library.
Since NativeLibrary is utilized via DynamicLibraryBundleInfo upstream,
the latter interface shall allow users to specify those attributes.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Uri to handle relative path
Fix IOUtil.cleanPathString(..) special case:
Special case '/a/./../b' -> '/b'
requires to resolve './' before '../'.
Allow IOUtil and Uri to handle relative path:
- IOUtil.getParentOf(..)
- IOUtil.cleanPathString(..)
Handle cases:
'a/./../b' -> 'b'
'.././b' -> '../b'
- Uri: Handle null scheme
|
|
|
|
|
|
|
|
|
|
|
|
| |
caller to skip relative futile lookup
IOUtil.getResource(..) and IOUtil.ClassResources, needs more clarity.
ClassLoader shall be passed explicitly next to the optional
relative context Class instance.
This allows better efficiency, i.e. caller can pass ClassLoader
but skip a possible relative lookup, if not existing.
|
|
|
|
| |
deflated files w/ zip-level 9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
test-executable ; Use CustomInflate for Performance
- Use 'WinMain' for Windows test-executable
This may have little difference than using std 'main' entry
- Add Windows x86_64 test executable
Since the reporter claims the test executable works well
on Windows i386, maybe utilizing a x86_64 test executable
on same VM fixes the issue
- Use CustomInflate for Performance
- Skips GZIP header
- Adds own custom header [magic, deflate-size, inflate-size]
- Own header allows simplified I/O read and deflation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
IOUtil.testDirExe():
- Satisfactory when executed
Failure to execute produce an IOException right at ProcessBuilder.start().
Hence we can allow an unexpected process exit value,
since we only want to learn whether executable files are allowed.
- More debug options
DEBUG_EXE: 'jogamp.debug.IOUtil.Exe'
DEBUG_EXE_NOSTREAM: 'jogamp.debug.IOUtil.Exe.NoStream'
- if DEBUG_EXE
- a pre-existing 'jogamp_exe_tst'+<SUFFIX> will be used as-is.
- the test-exe will not be deleted
- StreamMonitor is being used to dump stdout/stderr
if !DEBUG_EXE_NOSTREAM.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Use InterruptSource.Thread.create(..),
while reducing InterruptSource.Thread ctors to 3 variants.
- Use InterruptSource.Thread instead of java.lang.Thread where possible
- Use SourcedInterruptedException where possible
- SingletonInstanceServerSocket: start(), stop() and run()
- Persistent-Wait and Cancelable
- Add @since 2.3.2
|
|
|
|
| |
test cases to run concurrently
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PlatformPropsImpl.findSysLib(..).
This patch partially reverts of commit d12e4d4ea279998b27457691038e709879dcaca6.
NativeLibrary.open(..) requires search of system libraries,
since it loads the actual 'tool library' for which we generate the JNI binding.
The 'tool library' is preferably the system wide installed version,
e.g. libGL.so etc.
PlatformPropsImpl.findSysLib(..) also requires finding system libraries
as needed for PlatformPropsImpl.queryElfFile(..), i.e. using libjava.so etc.
Only the JNI 'glue library', glueing java calls to the 'tool library',
shall not use the system wide library search since we shall only use
JogAmp provided instances here.
This patch also reinstates binary compatibility w/ prev. GlueGen JARs
since NativeLibrary.enumerateLibraryPath(..) is public.
+++
Further more 'NativeLibrary.enumerateLibraryPath(..)'
now adds OSX system framework search _before_ the user path
in case 'searchSystemPath && searchSystemPathFirst'.
Original code always added this search to the end,
which does not match the intended behavior (-> bug).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
extension mechanism
NativeLibrary:
API change: Removed searchSystemPathFirst argument to the
open and enumerateLibraryPaths methods.
Removed the generic sun.boot.library.path system path and the
MacOS specific Frameworks paths from enumerateLibraryPaths.
JNILibLoaderBase, PlatformPropsImpl & TestElfReader01:
Updated to handle the NativeLibrary API change.
This change will prevent JogAmp modules to pickup and load unsupported
and old SUN JOGL 1 natives that may have been deployed with the JRE.
|
|
|
|
| |
of put32/get32
|