Package com.kenai.jffi
Interface Closure.Handle
-
- All Known Implementing Classes:
ClosureMagazine.Handle
,ClosurePool.Handle
- Enclosing interface:
- Closure
public static interface Closure.Handle
A Handle is allocated by theClosureManager
, as a strong reference to the native closure trampoline.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
dispose()
Releases the closure memory back to the operating system.void
free()
Deprecated.long
getAddress()
Gets the native code address of the closure.void
setAutoRelease(boolean autorelease)
Sets whether the closure memory should be released when theHandle
is garbage collected or not.
-
-
-
Method Detail
-
getAddress
long getAddress()
Gets the native code address of the closure. This can be passed into a native function that takes a function pointer.- Returns:
- The native address of the closure code.
-
setAutoRelease
void setAutoRelease(boolean autorelease)
Sets whether the closure memory should be released when theHandle
is garbage collected or not.- Parameters:
autorelease
- If true, the closure memory is automatically managed, else the closure memory must be explicitly freed.
-
dispose
void dispose()
Releases the closure memory back to the operating system. Although the closure trampoline memory will normally be released when theHandle
is garbage collected, this may not happen for some time, and is non-deterministic. This allows explicit control over memory reclamation.
-
free
@Deprecated void free()
Deprecated.
-
-