RFR: 8000617: It should be possible to allocate memory without the VM dying.

John Rose john.r.rose at oracle.com
Wed Oct 10 13:53:45 PDT 2012


On Oct 10, 2012, at 1:46 PM, Vitaly Davidovich wrote:

> Instead of bool true/false, could use an enum to make it more readable.

It would also be more type-safe.

I don't like the reference external addressible object (&nothrow, &dothrow), despite the fact that apparently it is part of std.

The reason is that this forces allocation sites to materialize an additional externally linked constant.  Such constants are not free, especially in PIC code.  Many allocation sites (esp. resource-based ones) are performance-sensitive, and adding an extra reference to a global symbol is a backwards move.  (We added 'THREAD' arguments most places to fix a similar though worse problem getting Thread::current.)  I would prefer a boolean, enum, fake pointer, or struct, instead of a reference to a global.

— John


More information about the hotspot-dev mailing list