[jdk9] (S) RFR: 8165463: Native implementation of sunmscapi should use operator new (nothrow) for allocations

Langer, Christoph christoph.langer at sap.com
Wed Sep 7 09:42:41 UTC 2016


Hi Ivan,

> > Also, I'm still wondering if you could define a little macro like:
> >
> > #define CHECKED_NEW_ARRAY(_pointer, _type, _size) \
> >          _pointer = new (env) _type[_size]; \
> >          if (_pointer == NULL) { \
> >              __leave; \
> >          }
> >
> > Then you could have a compact line at the allocation place like:
> > CHECKED_NEW_ARRAY(pszNameString, char, cchNameString)
> If there's no strong objection, I would prefer to keep it the way it is now.
> I think, it is important to see that the code contains the `jump`
> instruction without a need to unroll the macro.
> And this is also consistent with the way the rest of the code is organized.
Ok, sounds good to me :)

Best regards
Christoph



More information about the security-dev mailing list