Package io.github.jwharm.javagi.interop
Class Arenas
java.lang.Object
io.github.jwharm.javagi.interop.Arenas
Keeps a list of open Arenas that will be closed in a DestroyNotify callback.
The DestroyNotify callback will know which Arena to close, based on the
hashcode that is passed in the user_data parameter.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final MemorySegment
The upcall stub for the DestroyNotify callback method -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic MemorySegment
cacheArena
(Arena arena) This will add the Arena to the global static list of open arenas, and return a pointer to the hashcode of the Arena.static void
close_cb
(MemorySegment data) This is called by native code when it runs the DestroyNotify callback.
-
Field Details
-
CLOSE_CB_SYM
The upcall stub for the DestroyNotify callback method
-
-
Constructor Details
-
Arenas
public Arenas()
-
-
Method Details
-
close_cb
This is called by native code when it runs the DestroyNotify callback. It will close the accompanying Arena.- Parameters:
data
- pointer to the hashcode of the Arena to close
-
cacheArena
This will add the Arena to the global static list of open arenas, and return a pointer to the hashcode of the Arena.- Parameters:
arena
- the Arena to cache- Returns:
- a pointer to the hashcode of the Arena
-