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

2016-09-05 Thread Langer, Christoph
Hi Ivan, this looks like a good idea. Maybe the pattern to do new (std::nothrow), then check for 0 and throw OOM is a good candidate for a Macro which would keep the code a bit more compact? Best regards Christoph > -Original Message- > From: security-dev [mailto:security-dev-boun...@o

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

2016-09-05 Thread Ivan Gerasimov
Hello! In the native layer of sunmscapi provider, for memory allocations the ::operator new() is used. In (a very unlikely) case of failure, it will raise a C++ exception of type bad_alloc, which is bad, as we don't have handling code. One simple way to improve the situation would be to use :