RFR: JDK-8157141 & JDK-8166454: Solaris getisax(2) and meminfo(2) cleanup
Kim Barrett
kim.barrett at oracle.com
Tue Oct 4 16:18:09 UTC 2016
> On Oct 4, 2016, at 10:14 AM, Alan Burlison <Alan.Burlison at oracle.com> wrote:
>
> On 04/10/2016 09:15, David Holmes wrote:
>
>> But it shouldn't be passing sizeof(avs), it should be passing
>> (AV_HW2_IDX + 1)
>
> You are right, it expects the number of elements rather than the more usual convention of passing buffer length in bytes. Sigh.
Yikes! Sorry I missed that.
> I've replaced it with:
>
> uint_t avn = getisax(avs, sizeof(avs) / sizeof(avs[0]));
>
> as that will auto-adapt if the declaration of avs is ever changed.
We have a macro for that - ARRAY_SIZE(avs)
It’s in globalDefinitions.hpp, on the off chance that’s somehow not already being included.
More information about the hotspot-runtime-dev
mailing list