RFR: 8283225: ClassLoader.c produces incorrect OutOfMemory Exception when length is 0 (aix) [v4]
Tyler Steele
duke at openjdk.java.net
Fri Mar 18 15:28:32 UTC 2022
On Fri, 18 Mar 2022 07:43:21 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Tyler Steele has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Improve comment
>>
>> - Reword to avoid double use of malloc(X)
>> - Remove bug id
>
> src/java.base/share/native/libjava/ClassLoader.c line 104:
>
>> 102: // On AIX malloc(0) returns NULL which looks like an out-of-memory condition; so adjust it to malloc(1)
>> 103: #ifdef _AIX
>> 104: body = (jbyte *)malloc(length == 0 ? 1 : length);
>
> Can we use identification in the ifdef/else/endif block to make it a bit more readable. Also can you trim down the comment or split it over two lines to avoid the really long line (it makes it a bit easier for future side-by-side reviews).
I can split down the comment if you prefer. It might be appropriate to do in the as-yet-unmerged cleanup PR I have open for the same file.
I am not sure what you mean by 'use identification'. Can you clarify?
-------------
PR: https://git.openjdk.java.net/jdk/pull/7829
More information about the core-libs-dev
mailing list