Permalink
Browse files

cache structure layout results

  • Loading branch information...
1 parent bffbc30 commit 3ca38481c76d0ce3ab78eaf61698ba51effb3f3f @twall twall committed Nov 19, 2011
View
@@ -10,6 +10,7 @@ Features
* Automatically look up system error messages for LastErrorException.
* Improved callback thread-mapping support; re-use, rename, and group callback
threads.
+* Cache structure layout results, improving performance of structure creation.
* linux/arm 32-bit support (hardware provided by Alex Lam).
* linux/ppc 32-bit support (hardware provided by Fritiof Hedman).
* Preliminary linux/ia64, linux/ppc64 support (thanks to GCC compile farm).
View
@@ -21,41 +21,32 @@
# TODO
+* make native dll extraction from jar public, to use with user dlls packaged
+ in a jar
+
* dispose memory/callbacks in Native finalizer to ensure they run first
(use referencequeue to run them when they become unreachable)
-* fix setFieldOrder to *always* apply if used
-* cache structure information per-class
-
* make direct calls call back *once* to Java where conversion is required,
and process all arguments from there (instead of potentially swapping back
- and forth multipel times). This also makes it easer to perform conversions
+ and forth multiple times). This also makes it easer to perform conversions
(no native changes required).
-* direct/raw non-primitive array arguments (String[], Pointer[], NativeMapped[])
+* use libffi java raw?
+* direct/raw non-primitive array arguments (String[], Pointer[], NativeMapped[])
* ppc64 direct/raw failures (multiple)
-
* direct calls on ppc to varargs (callbacks) with FP args fail; avoid them for
now
-
* combine direct and interface mapping calling code where possible
-
-* make native dll extraction from jar public, to use with user dlls packaged
- in a jar
-
* Callback.PostCallWrite.write() cf PostCallRead
-
* GetPrimitiveArrayCritical: use this if flagged (by annotation? method name?)
-
* MethodArgument/ReturnMapper: per method mapping of arguments/return type.
Can use annotations as shorthand to initialize a map, but basically set up a
per-NativeLibrary (or per-Function?) map of methods to mappers.
Requires separate compilation of annotation handling.
-
* ditch type conversion context (?)
-
* packaging: 'types', 'convert/marshal' subpackages?
note: marshal/unmarshal vs to/fromnative: to/fromnative is more
explicit, since marshal/unmarshal doesn't indicate src/dst.
@@ -103,6 +94,8 @@
# DONE
+* cache structure information per-class
+* fix setFieldOrder to *always* apply if used
* Make a separate jar file for all OS-specific headers
Maybe make interfaces per-header file (winbase, winnt, stdlib, etc),
aggregated per-library (interface CLibrary extends stdlib, stdio, etc)
View
@@ -249,13 +249,20 @@
</jar>
</target>
- <target name="contrib-jars" depends="jar" description="Build contrib jars">
+ <target name="platform-jar" depends="jar">
<subant target="jar">
<property name="file.reference.jna.build" location="${build}"/>
<property name="file.reference.jna.jar" location="${build}/${jar}"/>
<property name="libs.junit.classpath" location="lib/junit.jar"/>
- <!-- platform.jar needs to be built first -->
<fileset dir="${contrib}" includes="platform/build.xml" />
+ </subant>
+ </target>
+
+ <target name="contrib-jars" depends="platform-jar" description="Build contrib jars">
+ <subant target="jar">
+ <property name="file.reference.jna.build" location="${build}"/>
+ <property name="file.reference.jna.jar" location="${build}/${jar}"/>
+ <property name="libs.junit.classpath" location="lib/junit.jar"/>
<fileset dir="${contrib}" includes="*/build.xml" excludes="platform/build.xml"/>
</subant>
</target>
@@ -577,7 +584,9 @@
<target name="contrib-test" depends="contrib-jars,compile-tests">
<subant target="test">
+ <property name="file.reference.jna.build" location="${build}"/>
<property name="file.reference.jna.jar" location="${build}/${jar}"/>
+ <property name="libs.junit.classpath" location="lib/junit.jar"/>
<fileset dir="${contrib}" includes="platform/build.xml"/>
</subant>
</target>
@@ -739,7 +739,6 @@ static boolean isVarArgs(Method m) {
public NativeMappedArray(NativeMapped[] arg) {
super(Native.getNativeSize(arg.getClass(), arg));
this.original = arg;
- Class nativeType = arg.getClass().getComponentType();
setValue(0, original, original.getClass());
}
public void read() {
@@ -22,8 +22,9 @@
public abstract class IntegerType extends Number implements NativeMapped {
private int size;
- private long value;
private Number number;
+ // Used by native code
+ private long value;
/** Create a zero-valued IntegerType. */
public IntegerType(int size) {
Oops, something went wrong. Retry.

0 comments on commit 3ca3848

Please sign in to comment.