| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
buffer cache once @ 'releaseVal(..)' code creation
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'ForceStaticInitCode'; Add 'ReturnsStringOnly', 'MaxOneElement' and 'ImmutableAccess'
Drop 'ManualStaticInitCall', 'ForceStaticInitCode':
With new CCodeUnit's `JVMUtil_NewDirectByteBufferCopy(..)` implementation
and generalized Buffers' methods, no specific init code is required anymore.
Add 'ReturnsStringOnly', 'MaxOneElement' and 'ImmutableAccess':
- 'ReturnsStringOnly' only String getter, drop ByteBuffer/byte[]
- 'MaxOneElement' only one element maximum for pointer reference
- 'ImmutableAccess' strict read-only, also reduces generated code a lot
|
|
|
|
| |
PrintWriter...)
|
|
|
|
|
|
|
|
|
| |
covering multiple FunctionEmitter allowing to unify output, decoration and dynamic helper code injection per unit
- Handles file open and have public ctor emitAutogeneratedWarning(..), being self-contained
- Includes `JVMUtil_NewDirectByteBufferCopy(..)` implementation in CCodeUnit,
may be injected if required in customCode via emitHeader(..)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
getPreferredFormat() and isSupported(); Add setChannelLimit() impacting
Add setChannelLimit() impacting getPreferredFormat() and isSupported(),
i.e. to limit channels for e.g. JOAL/OpenAL spatial 3D sound usage.
getNativeFormat() shall be unaffected.
getMaxSupportedChannels() is redudandant -> getPreferredFormat()
|
|
|
|
| |
universal API interface
|
|
|
|
| |
precision when dealing with stats, averages etc
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
AudioFrame; init(): Use getAvgFrameDuration() for queue growth and limit.
This change renders buffer dequeueing, growth and limit sticking w/ [ms] values
while getAvgFrameDuration() assists frame count determination.
getAvgFrameDuration() is calculated when buffer is fully filled (queuedBytes / queuedFrames),
i.e. a proper representation to be used to dequeue in duration range
as well as for growth.
This further decouples the frameDuration{->Hint} parameter in init(),
as it is now only used for the initial buffer count (and latency adjustment).
|
|
|
|
| |
using enqueueData() -> 1 AudioFrame
|
|
|
|
| |
null in case no sub-directory is desired
|
|
|
|
| |
JOAL/OpenAL implementation
|
| |
|
|
|
|
| |
API doc
|
|
|
|
| |
type int
|
|
|
|
| |
moved to com.jogamp.openal.util.ALAudioSink (public)
|
|
|
|
| |
less management overhead (-> OpenAL + Synthesizer)
|
|
|
|
|
|
|
| |
for cross module usage in JOAL, JOGL, ...
Supply AudioSink: NullAudioSink and JavaSoundAudioSink by GlueGen,
ALAudioSink is supplied via JOAL.
|
|
|
|
|
|
|
|
|
|
| |
(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>
|
|
|
|
| |
stream is copied.
|
|
|
|
| |
'totalNumBytes' argument, since we have no user-feedback callback passed.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Win32 clock_gettime() implementation.
Consider return code on failed native clock_gettime(..) call
- Return Instant.EPOCH for all Instant variations (essentially 0)
- Return 0 for all 'long' variations (ms, ns)
Add Win32 clock_gettime() implementation.
- Source: https://github.com/Alexpux/mingw-w64/blob/master/mingw-w64-libraries/winpthreads/src/clock.c
- Public Domain within mingw-w64, included here to simplify linkage.
- Tested on Win10 64bit w/ TestTextRendererNEWT00, all values are OK
|
|
|
|
| |
duration since module startup and not time.
|
|
|
|
|
|
|
|
|
|
|
| |
startup, retrievable via getMonotonicStartupTime(). (performance)
Settings two long fields in getMonotonicTime() and creating Instant and using Duration
for high-frequency counter is too expensive.
currentTimeNanos() subtracts the startup time from the current monotonic time and returns the
resulting duration in nanoseconds, which lasts for 292 years since module startup.
This satisfies performance counter requirements.
|
| |
|
|
|
|
|
|
|
|
|
| |
(sec + nsec), currentTimeMillis() is also monotonic now, reused by Platform. Dropped Platform.currentTimeMicros()
Clock and its implementation was copied from jaulibs, a spin-off from Direct-BT.
The implementation uses `clock_gettime(CLOCK_MONOTONIC, &t)` and is considered safe and high-performant
as it avoids a kernel call via VDSO (GNU/Linux).
|
|
|
|
|
|
| |
flexibility/performance.
Notable: The array-put is slower than small range single-puts, e.g. put3i(..).
|
| |
|
|
|
|
| |
to 'java.library.path', others are absolute
|
|
|
|
|
|
| |
lib couldn't be loaded (avoid showing misleading orig exception)
.. and detail some debug output. Both, own exception and debug output expose NativeLibrary.getSystemEnvLibraryPaths()
|
|
|
|
|
|
| |
is being resolved as absolute-canonical as required for System.load*()
Further, detailed DEBUG messages are added on -Djogamp.debug.NativeLibrary
|
|
|
|
| |
.. content
|
| |
|
|
|
|
| |
'const' qualifier
|
|
|
|
| |
'yield_thread()' to avoid potential Java>17 collision (JEP 361)
|
| |
|
|
|
|
| |
and doPrivileged() for Java17+
|
|
|
|
|
|
|
|
| |
PlatformPropsImpl: Remove static OSXVersion and Version* vars, add JAVA_17 and JAVA_21 flag.
PlatformPropsImpl's static OSXVersion is JOGL specific and will be moved into its GLContextImpl.
PlatformPropsImpl's static Version are not required and eats up memory where it can be used transitionary.
|
| |
|
| |
|
| |
|
|
|
|
| |
IdentityWeakReference: hash is final.
|
|
|
|
| |
'PowerOf2' functions
|
|
|
|
| |
IdentityWeakReference static
|
|
|
|
|
|
|
|
|
|
| |
Origin <https://github.com/apache/avro/blob/master/lang/java/avro/src/main/java/org/apache/avro/util/WeakIdentityHashMap.java>
from their commit 70260919426f89825ca148f5ee815f3b2cf4764d.
Apache License Version 2.0 until.
Using our JogAmp 'New BSD 2-Clause License' for changes after this initial commit.
Related to Bug 1312, where we like to utilize a WeakIdentityHashMap,
allowing to have cached shared GLContext to disappear .. a compromise.
|
|
|
|
| |
API >= 24, use Context.MODE_PRIVATE for temp cache
|