When someone creates bindings from the C library to Java (or any other garbage-collected language without destructors that are guaranteed to be executed), how do they deal with properly freeing non-garbage memory?
EDIT: What I think about (I know this is not explicitly stated in my original question) is when a portion of the non-gc'ed memory contains links to resources other than gc'ed that should be freed when this object is freed. For example, if you have a linked list without a gc'ed node, which is the head of a long list of such nodes, and you want the gc system to automatically clear it automatically, how do you set it?
source
share