RFR: 8263718: unused-result warning happens at os_linux.cpp [v2]

Yasumasa Suenaga ysuenaga at openjdk.java.net
Tue Mar 30 05:58:20 UTC 2021


On Tue, 30 Mar 2021 05:06:05 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Yasumasa Suenaga has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Remove alloca() from some platforms
>
> src/hotspot/os/linux/os_linux.cpp line 671:
> 
>> 669:   static int counter = 0;
>> 670:   int pid = os::current_process_id();
>> 671:   void *stackmem = alloca(((pid ^ counter++) & 7) * 128);
> 
> Please add a comment:
> 
> // Ensure the alloca result is used in a way that prevents the compiler from eliding it.

Added it in new commit.

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

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


More information about the hotspot-dev mailing list