On Thu, 4 Feb 2021 16:57:37 GMT, Thomas Stuefe <stu...@openjdk.org> wrote:

>> I'm not sure every platform have always agreed free(NULL) is a noop. I 
>> suspect all the currently supported ones do, though?
>
>> I'm not sure every platform have always agreed free(NULL) is a noop. I 
>> suspect all the currently supported ones do, though?
> 
> Its standard behavior.
> 
> Posix: https://pubs.opengroup.org/onlinepubs/009695399/functions/free.html 
> "If ptr is a null pointer, no action shall occur. "
> Windows: 
> https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/free?view=msvc-160
>  " If memblock is NULL, the pointer is ignored and free immediately returns. "
> 
> So it should be okay.

Right. I dialed back the changes here since this is a bug fix that should be 
kept minimal. I have another change in the pipeline that will touch code here 
that can double down on cleaning up.

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

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

Reply via email to