JavaCpp v0.3 Release Notes

Release Date: 2012-11-04 // over 9 years ago
    • Added Pointer.withDeallocator(Pointer) method to attach easily a custom Deallocator created out of a static void deallocate(Pointer) method in the subclass, including native ones such as @Namespace @Name("delete") static native void deallocate(Pointer)
    • A name starting with "::", for example @Name("::std::string") or @Namespace("::std"), now drops the remaining enclosing scope
    • Removed confusing cast value of @Adapter instead relying on new String[] value of @Cast to order multiple casts
    • Renamed various variables in Generator to make the generated code more readable
    • Fixed memory corruption when using an adapter or @ByRef on a function that returns by value an std::vector<> or std::string (issue #26)
    • Added Pointer.zero() method that calls memset(0) on the range
    • For easier memory management, more than one Pointer now allowed to share the deallocator when "casting" them
    • Upgraded references of the Android NDK to version r8b
    • Fixed JavaCPP_log() not printing correctly (issue #27)
    • Added functionality to access easily FunctionPointer callbacks by their names from C/C++: We can annotate them with @Name and build with the new -header option to get their declarations in a header file, while the Builder links with the jvm library by default
    • Loader now displays an informative error message when trying to use an undefined compiler.options with @Platform(options="") (issue #24)
    • Pointer.deallocator() would needlessly enqueue Deallocator objects pointing to the native NULL address
    • Added support for C++ "functors" based on the operator(), which gets used when annotating a FunctionPointer method parameter with @ByRef or @ByVal
    • For convenience in Scala, added apply() as an acceptable caller method name within a FunctionPointer, in addition to call()
    • Fixed @Cast not working along parameters with an @Adapter or when attempting to return the argument
    • Generator would ignore Pointer.position() in the case of @ByPtrPtr and @ByPtrRef parameters
    • Replaced hack to create a Pointer from a Buffer object with something more standard
    • Fixed Loader.sizeof(Pointer.class) to return the sizeof(void*)
    • In addition to methods and parameters, we may now apply @Adapter to annotation types as well, allowing us to shorten expressions like @Adapter("VectorAdapter<int>") int[] to just @StdVector int[], for std::vector<int> support, and similarly for @StdString and std::string
    • Fixed callback parameter casting of primitive and String types
    • An empty @Namespace can now be used to let Generator know of entities that are not part of any scope, such as macros and operators
    • Turned FunctionPointer into an abstract class with protected constructors, but if users still try to use it as function parameters, Generator now logs a warning indicating that a subclass should be used (issue #23)
    • Removed the out value of the @Adapter annotation: All adapters are now "out" by default, unless @Const also appears on the same element
    • Fixed Pointer.equals(null) throwing NullPointerException (issue #22)
    • @NoOffset would erroneously prevent sizeof() operations from getting generated