RFR: 8256302: releasing oopStorage when deflating allows for faster deleting [v5]
David Holmes
dholmes at openjdk.org
Tue Jun 6 07:11:03 UTC 2023
On Mon, 5 Jun 2023 19:29:17 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:
>> This is confusing - why is `is_null` being used as a proxy for checking the current thread's state?
>
> I look at it a little different, I guess. Here in the destructor we check if
> the object's oop storage has already been released. If it has not, then
> we do the `release_object()` call. This is like seeing if a buffer has
> been already freed and taking care of the free if it is still needed. Here
> I care about the `_object`'s state (and not the thread's state).
>
> I don't check the current thread's state here nor do I assert it. Based
> on my testing, if this destructor is called from an unsafe context and
> we need to do the `release_object()` call, the we'll fail a sanity check
> down in the `release_object()` call stack.
Okay it was your "(and safe)" comment that implied to me that `is_null` was somehow also being used to infer the thread's state was safe to do the release.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/11296#discussion_r1219044524
More information about the hotspot-runtime-dev
mailing list