RFR: 8263185: Mallinfo deprecated in glibc 2.33 [v4]

Christoph Göttschkes cgo at openjdk.java.net
Wed Mar 17 09:36:12 UTC 2021


On Wed, 17 Mar 2021 00:26:48 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Christoph Göttschkes has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Resolve mallinfo and mallinfo2 in os::init.
>
> src/hotspot/os/linux/os_linux.cpp line 2238:
> 
>> 2236:   bool called_mallinfo = false;
>> 2237:   bool might_have_wrapped = false;
>> 2238: #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 33)
> 
> This is not needed - you are using a build-time value to determine whether to perform a runtime action. The mallinfo2 call should be attempted on all platforms regardless of the build platform characteristic.

But we need to know the structure of the return type, which needs to be known at compile time because it is allocated on the stack. The only way I see to make this not compile time dependent would be to copy the structure from the system header to the HotSpot sources and always assume that every platform, which provides a mallinfo2 function, has the same prototype. I would like to avoid copying the struct definition from the system header to the HotSpot sources. Or am I missing something?

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

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


More information about the hotspot-runtime-dev mailing list