RFR: 8000617: It should be possible to allocate memory without the VM dying.
Nils Loodin
nils.loodin at oracle.com
Thu Oct 11 05:55:30 PDT 2012
Hey guys.
Your comments on this issue are great! So here's another version that
uses an enum instead of std::nothrow_t trickery!
http://cr.openjdk.java.net/~nloodin/8000617/webrev.03/
Regards,
Nils Loodin
On 10/11/2012 01:21 PM, Dmitry Samersoff wrote:
> Keith,
>
> Personally, I would prefer explicit AllocWithoutThrow(...) function.
>
> -Dmitry
>
>
>
> On 2012-10-11 03:40, Keith McGuigan wrote:
>>
>> Personally, I don't have strong feelings on how this is implemented,
>> other than it should be done in a way that's maintainable going forward
>> and easily understandable by future generations of hotspot developers.
>> With this in mind, the only potential solution that I don't like is
>> using a boolean with naked true/false values as discriminators.
>>
>> Using some sort of "failure mode" parameter is the natural way to do
>> this, whether it be enums, std::nothrow_t, or whatever. Since
>> std::nothrow_t already has a type and one value, and is already present
>> in the few places we're interested in, it seemed easy to simple just add
>> a new value to use. However if this ends up being confusing because
>> this is not the normal use of std::notype_t, then fine, we can do
>> something else.
>>
>> --
>> - Keith
>
>
More information about the hotspot-dev
mailing list