All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog.
- Support to build with text >= 2 (#200)
- Support for building with ghc-8.10
- Expose functions in the API to start and stop the finalizer thread. These functions are needed in applications that initialize the JVM through other means than JNI.
- Support for building with ghc-9.0.1.
- Removed Cabal support in favor of Bazel.
-
Added missing cpphs-cpp script needed for OSX builds (#170).
-
Have Foreign.JNI.String.fromByteString succeed on empty strings (#167).
-
Have finalizers of global references run in an attached thread (#150). Now programs using jni must link with the threaded runtime.
-
Failed lookups with getMethodID and getStaticMethodID now list the overloadings of the method that was searched (#164).
-
Exceptions raised in the JVM do not automatically print a line in stderr. Instead, a Haskell function is provided to print the stack trace of any JVMException (#168).
- Added support for ghc-8.10.1 and ghc-8.11 (HEAD)
- An interface based on linear types
- NIO support: operations on direct byte buffers
- Functions getArrayElements
- Removed support for ghc < 8.10.1
- Fixed runInAttachedThread which would otherwise throw an exception everytime it was called.
ShowSing JType instance to build with singletons-2.4.
- Added
SingI
as superclass constraint ofIsPrimitiveType
. - Added Bazel build files for jni.
- The type of
newLocalRef
to follownewGlobalRef
. Both return reference wrappers now.
attachCurrentThreadAsDaemon
,detachCurrentThread
andrunInAttachedThread
are provided to have the application attach and detach threads.
- Threads are no longer attached automatically to the JVM.
- We check that the calling thread is bound when creating the JVM.
arrayUpcast
for upcasting array types.NFData
instances.- Add support for inline-c-0.6 so
src/Foreign/JNI.c
does not cause unnecessary recompilation. instance Show (Sing (a :: JType))
.singToIsReferenceType
, to construct IsReferenceType instances from singletons.
(get|set)ObjectArrayElement
have more general type signatures (they work on anyCoercible
value).- JNI strings are now allocated in pinned memory on the Haskell heap where possible, rather than the C heap. This puts pressure on the Haskell GC to reclaim memory more often.
NUL
character handling.fromChars
didn't always yield a string with a terminatingNUL
character.toByteStringe
in addition, was not discarding the terminatingNUL
character properly.Foreign.JNI
now includesstdio.h
to help builds in Android.- Fixed random lockups in the read-write locks used to finalize JNI.
ojectFromPtr
/unsafeObjectToPtr
to convert from/to a pointer type.newJVM
/destroyJVM
, for use in GHCi, wherewithJVM
isn't appropriate.
- Extend
newArray
to work over any reference type.