On Thu, 17 Mar 2022 14:48:09 GMT, Roger Riggs wrote:
>> src/java.base/share/native/libjava/ClassLoader.c line 102:
>>
>>> 100: }
>>> 101:
>>> 102: // On malloc(0), implementators of malloc(3) have the choice to
>>> return either
>>
>> It is confusing to mix `malloc(0)`, where you are passing an argument zero
>> to malloc, with `malloc(3)` which actually means the definition of malloc as
>> per the man page in section 3.
>>
>> Given this is only an issue on AIX the comment can simply say:
>>
>> `// On AIX malloc(0) returns NULL which looks like an out-of-memory
>> condition; so adjust it to malloc(1)`.
>
> I would omit the bug number reference, they get stale and do not age well,
> cluttering up the source.
> Git blame can be used to find the origin of the comment if needed.
I changed to the streamlined comment and removed the bug id. Thanks for your
suggestions.
-
PR: https://git.openjdk.java.net/jdk/pull/7829