On Fri, 30 Jul 2021 16:33:17 GMT, Zhengyu Gu <z...@openjdk.org> wrote:

>> The code is implicitly thread-safe because the hashmap is only modified in 
>> the pre-NMT-init phase. After NMT initialization, the table is read-only. 
>> During pre-NMT-init we are effectively single-threaded - at most two threads 
>> access the map, the thread loading the libjvm, and the thread calling 
>> CreateJavaVM, but not at the same time.
>> 
>> See also the asserts in the AllStatic class `NMTPreInit`.
>> 
>> (I should have described it more clearly, will add a comment.)
>
> So, you are saying that there is no memory that is malloc'd pre-NMT-init 
> phase and freed post-NMT-init phase?

Okay, I see. It just leaks those memory, so the table can be read-only.

-------------

PR: https://git.openjdk.java.net/jdk/pull/4874

Reply via email to