MemorySession cleanup order

Manuel Bleichenbacher manuel.bleichenbacher at gmail.com
Wed Sep 14 21:28:38 UTC 2022


The documentation for MemorySession.addCloseAction() states that the order
of custom cleanup actions is unspecified. But it only hints at the order of
custom close actions vs. closing memory segments.

Is it correct that memory segments are closed first, and then the custom
cleanup actions are executed?

If so, is there a specific reason for it? It would be more useful to other
way round.

I have several cases requiring cleanup of data structures residing in a
memory segment. It would be most natural to use custom cleanup actions to
do so as their lifespans end at the same time. But given the current order,
a far less elegant way is needed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/panama-dev/attachments/20220914/b66f8b2d/attachment.htm>


More information about the panama-dev mailing list