1 message in net.java.dev.jna.users[jna-users] experimental raw interface
FromSent OnAttachments
Timothy WallMay 19, 2009 2:59 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[jna-users] experimental raw interfaceActions...
From:Timothy Wall (twal@dev.java.net)
Date:May 19, 2009 2:59:08 am
List:net.java.dev.jna.users

I've added a new, experimental raw interface to JNA, which performs much better than the original interface mapping, although it's currently less flexible w/r/t type mapping.

Example mapping:

public class MathLibrary { public static native double cos(double x); public static native double sin(double x);

static { Native.register("m"); } }

You'll see on the order of a 10X speedup mapping methods this way. Currently only primitive types and the Pointer type are supported (no Java String, Structure or primitive arrays yet, although you should be able to manually convert those to Pointer).

I'll check in a few native builds to make it easier to use out of the box, but at the moment you'll need to build your own out of SVN.