JniActual

@Target(allowedTargets = [AnnotationTarget.FUNCTION])
annotation class JniActual(val className: String, val methodName: String = "")(source)

Indicates that a function (public or internal) is the actual implementation of a function expected to be provided through JNI.

Should be applied to functions that:

  • are top-level

  • have no context parameter or a single one of type JniEnv

  • have a receiver of type JObject or JClass or don't have any receiver.

A function may also declare a native-memory placement context parameter: AutofreeScope, NativePlacement, ArenaBase or MemScope. So the body can allocate through the placement.

Properties

Link copied to clipboard

The fully qualified name of the class. E.g., "com.example.NativeHelper"

Link copied to clipboard

The name of the method in the class, no mater static or instance. E.g., "nativeComputation". Optional: may be omitted if the name is the same as the marked function has.