| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
save mapped ByteBuffer memory
Also:
- fix dbgDump(..) FileChannel access, test if openend.
- add DEBUG dumps on CTOR, Close and notifyLengthChangeImpl
|
| |
|
|
|
|
| |
Cleanup / Preparation)
|
|
|
|
| |
detection
|
|
|
|
|
|
|
|
|
|
|
| |
FLUSH_PRE_SOFT)
FLUSH_PRE_SOFT cannot be handled by some platforms, e.g. Windows 32bit.
FLUSH_PRE_HARD is the most reliable caching mode
and it will fallback to FLUSH_PRE_SOFT if no method for 'cleaner' exists.
Further, FLUSH_PRE_HARD turns our to be the fastest mode as well.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Validate active and GC'ed mapped-buffer count
in cleanAllSlices() via close() ..
- Fix missing unmapping last buffer in notifyLengthChangeImpl(),
branch criteria was off by one.
- cleanSlice(..) now also issues cleanBuffer(..) on the GC'ed entry,
hence if WeakReference is still alive, enforce it's release.
- cleanBuffer(..) reverts FLUSH_PRE_HARD -> FLUSH_PRE_SOFT
in case of an error.
- flush() -> flush(boolean metaData) to expose FileChannel.force(metaData).
- Add synchronous mode, flushing/syncing the mapped buffers when
in READ_WRITE mapping mode and issue FileChannel.force() if not READ_ONLY.
Above is implemented via flush()/flushImpl(..) for buffers and FileChannel,
as well as in syncSlice(..) for buffers only.
flush*()/syncSlice() is covered by:
- setLength()
- notifyLengthChange*(..)
- nextSlice()
Always issue flushImpl() in close().
- Windows: Clean all buffers in setLength(),
otherwise Windows will report:
- Windows: Catch MappedByteBuffer.force() IOException
- Optimization of position(..)
position(..) is now standalone to allow issuing flushSlice(..)
before gathering the new mapped buffer.
This shall avoid one extra cache miss.
Hence rename positionImpl(..) -> position2(..).
- All MappedByteBufferOutputStream.write(..) methods
issue syncSlice(..) on the last written current slice
to ensure new 'synchronous' mode is honored.
+++
Unit tests:
- Ensure test files are being deleted
- TestByteBufferCopyStream: Reduced test file size to more sensible values.
-
|
|
|
|
| |
to stream copy as well as direct memory mapped ByteBuffer access
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
OutputStream impl.
Added MappedByteBufferOutputStream as a child instance of MappedByteBufferInputStream,
since the latter already manages the file's mapped buffer slices.
Current design is:
- MappedByteBufferInputStream (parent)
- MappedByteBufferOutputStream
this is due to InputStream and OutputStream not being interfaces,
but most functionality is provided in one class.
We could redesign both as follows:
- MappedByteBufferIOStream (parent)
- MappedByteBufferInputStream
- MappedByteBufferOutputStream
This might visualize things better .. dunno whether its worth the
extra redirection.
+++
MappedByteBufferInputStream:
- Adding [file] resize support via custom FileResizeOp
- All construction happens via ctors
- Handle refCount, incr. by ctor and getOutputStream(..), decr by close
- Check whether stream is closed already -> IOException
- Simplify / Reuse code
MappedByteBufferOutputStream:
- Adding simple write operations
|
|
|
|
| |
IOException (Add note to FLUSH_NONE); Reduce test load / duration.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
InputStream impl., incl. mark/reset
- ByteBufferInputStream simply impl. InputStream for an arbitrary 2MiB restricted ByteBuffer
- Users may only need a smaller implementation for 'smaller' file sizes
or for streaming a [native] ByteBuffer.
- MappedByteBufferInputStream impl. InputStream for any file size,
while slicing the total size to memory mapped buffers via the given FileChannel.
The latter are mapped lazily and diff. flush/cache methods are supported
to ease virtual memory usage.
- TestByteBufferInputStream: Basic unit test for basic functionality and perf. stats.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
- Change non static accesses to static members using declaring type
- Change indirect accesses to static members to direct accesses (accesses through subtypes)
- Add final modifier to private fields
- Add final modifier to method parameters
- Add final modifier to local variables
- Remove unnecessary casts
- Remove unnecessary '$NON-NLS$' tags
- Remove trailing white spaces on all lines
|
|
|
|
| |
float[] backing-array - refine API doc w/ backing-array semantics
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and string (code generation)
Enhance compound access as delivered by Bug 1022,
to also generate accessors (getter and setter) for
array, pointer and string types.
Allow configuration of array length either via
their internal size (c-header) or config 'ReturnedArrayLength'.
'ReturnedArrayLength' allows specifying a java expression.
Canonical field names of compounds are _now_ specified as
follows for configuration entries:
COMPOUND.FIELD
e.g.
StructA.fieldB
Also allow configuration of pointer fields to be treated as
referenced arrays via 'ReturnedArrayLength'.
Further, allow specifying 'pointer fields' as String values
via 'ReturnsString' configuration.
++++
Implementation details:
- handle above described accessor features
- enhance JavaDoc for generated accessors
- generate native JNI compound and string accessor on demand
- encapsule accessor code generation in their own methods
- enhance exception messages
- enhance type verbosity in debug mode
- verbose debug output via GlueGen.debug()
Tests:
- Features covered by test1.[ch]
and Test1p1JavaEmitter and Test1p2ProcAddressEmitter
- Validated compilation and unit tests for modules:
- joal
- jogl (minor config changes req.)
- jocl (minor config changes req.)
|
|
|
|
| |
Signed-off-by: Harvey Harrison <[email protected]>
|
|
|
|
| |
Signed-off-by: Harvey Harrison <[email protected]>
|
| |
|
|
|
|
| |
Buffers.sizeOfBufferElem(..) call.
|
|
|
|
| |
byte-buffer w/ given elementSize semantics
|
|
|
|
|
|
|
|
|
|
|
|
| |
sizeOfBufferElem(Buffer) -> sizeOfBufferElem(Object) to include NativeBuffer<?>
Misc:
- Add remainingElem(Object buffer).
- Removed 'sizeOfBufferType(Class<?> bufferType)', since we don't use such calling convention w/ class type
Note: remainingBytes(..) exist to allow using only one branch traversal to return the remaining size in bytes
instead of 2, remaining(obj) and sizeOfBufferElem(obj).
Note: The methods can take NativeBuffer<?> as an argument.
|
| |
|
| |
|
|
|
|
| |
Signed-off-by: Harvey Harrison <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
May break GCJ/ECJ .. needs to be revised.
- Adding JAVA_6 in PlatformPropsImpl
- Buffers.isDirect() chooses fast-path iff JAVA_6, otherwise using reflection (GCJ/ECJ)
- Adding JAVA_6 info in VersionUtil
- API doc: Refine JAVA_SE and JAVA_6 spec.
TODO: In case GCJ etc is unable to compile the JAVA_6 code
even though it uses a static condition (probably not),
We have to wrap isStatic in an own class, one for JAVA_6 and one for <= 1.5.
This will be a good exercise for further issues we may have w/ Java <= 1.5.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fix for the runtime error using GCJ gij JRE:
java.lang.NoSuchMethodError: method java.nio.Buffer.isDirect with signature ()Z was not found.
at com.jogamp.common.nio.Buffers.isDirect(Buffers.java:363)
Also Eclipse ecj refuses to compile code using java.nio.Buffer.isDirect().
----------
1. ERROR
...
return ((Buffer) buf).isDirect();
^^^^^^^^
The method isDirect() is undefined for the type Buffer
Signed-off-by: Xerxes Rånby <[email protected]>
|
|/ |
|
|
|
|
|
|
|
|
|
|
| |
for short[]
For short[] Java code gets emitted for an StructAccessor object that uses:
void setShortsAt(int i, short[] shorts)
short[] getShortsAt(int i, short[] shorts)
Problem was that StructAccessor.java had no such methods - added.
|
|
|
|
|
|
|
|
|
| |
buffer (was missing).
This is an API regression as introduced in commit 25cc744f6bd5ca97e0ae58fa7e1c35f7b0f3046d
where JOGL's BufferUtil and GlueGen's were merged and API doc elaborated.
The latter states the desired fact that the source passed buffer's position shall remain
unchanged, however no code was added to take care of this detail.
|
|
|
|
| |
util. ValueConv for primitive type value conversion
|
| |
|
|
|
|
|
|
| |
sb, Buffer buffer)"
Sometimes we need to see details of a Buffer w/ it's content, e.g. for debugging purposes.
|
|
|
|
| |
86e8c3a8d9f430700e07c485127130da68618e9d
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
destination handling (Float/Long/Double/..)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TempJarCache.bootstrapNativeLib(..) usage
- Moving to Platform solves former interdependencies between GlueGenJNILibLoader/Platform
- TempJarCache is being setup w/ bootstraping the gluegen-rt native lib jar file.
Interesting here is that when using Oracle's JRE w/ Applets/JNLP the
current dbg output is:
gluegen-rt: url-root http://risa/deployment/test/jau02s/jar/
gluegen-rt: nativeJarURL jar:http://risa/deployment/test/jau02s/jar/gluegen-rt-natives-linux-amd64.jar!/
gluegen-rt: nativeJar /home/sven/.java/deployment/cache/6.0/49/3c6d1e31-2c90f42e
IE the JRE implementation already deduces the online link to the Applet/JNLP cache.
This makes the implementation much simpler, ie. same for application and Applets/JNLP.
Have to verify w/ other Java impl. sure - and add same logic for the JOGL part.
|
|
|
|
|
|
|
|
| |
gluegen-rt native lib as well
- removed redundance
- move proper JNLPAppletLauncher custom libloader code into JNILibLoaderBase
- prepares for new JAR temp cache ..
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
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
"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.
FIXES 32bit unit test, works well (static) on 32/64 bit (unix).
TODO: Respect diff alignment for OS/ARCH either by offset tables for all, or runtime computing.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]>
|
| |
|