| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Harvey Harrison <[email protected]>
|
|
|
|
| |
Signed-off-by: Harvey Harrison <[email protected]>
|
|
|
|
|
|
|
|
| |
PROCADDRESS_VAR_PREFIX instance, add checkAllPermissions() for reset() and initEntry(..)
- Generated ProcAddressTable's function handles are all package private
- Generated ProcAddressTable's visibility can be set via 'AccessControl' config, default: public.
- ProcAddressTable's reset() and initEntry(..) perform checkAllPermissions() 1st.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
'gluegen' C Structs on-the-fly (2-pass actually).
Convenient annotation processing (APT) hooked to 'javac' (1.6) via gluegen.jar META-INF
service provider 'javax.annotation.processing.Processor' -> 'com.jogamp.gluegen.structgen.CStructAnnotationProcessor'.
Am implicit APT / JAVAC would be possible, however - to have a proper process
the unit test utilizes an explicit 2 pass run:
<!-- Annotation Processor Only - First -->
<javac destdir="${build_t.java}">
<classpath refid="junit.compile.classpath"/>
<compilerarg value="-proc:only"/>
<compilerarg value="-J-Djogamp.gluegen.structgen.debug"/>
<compilerarg value="-J-Djogamp.gluegen.structgen.output=${build_t.gen}/classes"/>
<src path="${test.base.dir}/com/jogamp/gluegen/test/junit/structgen"/>
</javac>
<!-- Javac Only - Second -->
<javac destdir="${build_t.java}">
<classpath refid="junit.compile.classpath"/>
<compilerarg value="-proc:none"/>
<src path="${test.base.dir}"/>
<src path="${build_t.gen}" />
</javac>
Original code from Michael Bien's 'superglue' git://github.com/mbien/superglue.git,
finally merged to GlueGen (as once intended).
Note: The APT javac pass requires to use 'gluegen.jar' instead of 'gluegen-rt.jar' !
The 2-pass process also alows using the runtime gluegen-rt.jar and hence ensures
clean namespace check at compilation.
|
|
|
|
|
|
| |
PointerBuffer, since referenced memory-size is arch dependent
Added extensive PointerBuffer unit tests w/ new mapping in generated test class.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
|
|
|
|
| |
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 .
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
integer opaque in struct
|
|
|
|
|
|
|
| |
Reversed Type relocation (commit 92d6c9dc5fa72b01703456452c60822f36c14fff)
from com.jogamp.gluegen.runtime.types back to com.jogamp.gluegen.cgram.types
Enabled MemoryLayoutType.setLayouted(), avoiding double layout
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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, ..
|
|
|
|
|
|
| |
- removed Int64Buffer since it is no longer needed for LongBuffer emulation
Signed-off-by: Sven Gothel <[email protected]>
|
|
|