RFR(xxxs) (jdk10): 8168542: os::realloc should return a valid pointer for input size=0
david.holmes at oracle.com
Sun Feb 5 02:50:13 UTC 2017
On 4/02/2017 10:09 PM, Thomas Stüfe wrote:
> Hi guys,
> picking up this trivial issue which got pushed to jdk10, could I please
> have a re-review? Oh, also a sponsor.
> For reference, the old discussion back in october 16:
I am still rather confused by both existing code and proposed change -
the code just seems wrong if passed in a zero size. Passing in zero is a
bug AFAICS and if buggy code passes in zero then how do we know what it
will do with the returned value from os::realloc ?
> The webrev is unchanged from the proposal for jdk9, just rebased to
> @Chris, I decided to not follow your suggestion to move the comparison
> into the #ifndef assert. You are right, this is redundant with the check
> inside os::malloc(), but as you said, checking at the entry of
> os::realloc() makes it clearer.
> Thank you!
> Kind Regards, Thomas
More information about the hotspot-runtime-dev