On Mon, 25 Oct 2021 23:21:02 GMT, Serguei Spitsyn <sspit...@openjdk.org> wrote:
>> Yes, I think that combining release_C_heap_structures and >> release_C_heap_structures_internal into single release_C_heap_structures >> with a default parameter will simplify code a little bit. But I'm not sure >> it is that important and would leave it for you to decide. :) > > I did not see the last comment from David when added mine. In fact, I like > the David's suggestion to call `ik->constants()->release_C_heap_structures()` > directly. It looks more simple to me. I'd prefer that the callers do NOT release the constant pool CHeap structures directly. The main caller, during class unloading has the InstanceKlass as a handle to delete and it would be really easy to miss the constant pool case. The constant pool is contained by the InstanceKlass in this case. Deallocate_contents is the only exception for the exceptional case where we have added the InstanceKlass to the deallocate list. ------------- PR: https://git.openjdk.java.net/jdk/pull/6105