[OpenJDK 2D-Dev] java2d coding using SAFE_SIZE_ARRAY_ALLOC / safe_Malloc

Baesken, Matthias matthias.baesken at sap.com
Wed May 30 15:08:48 UTC 2018


Hello ,  there is still some  java2d coding  where  SAFE_SIZE_ARRAY_ALLOC / safe_Malloc    is used  and  the  (potentially occurring) exception is not handled .

This leads to  CL warnings  (when enabled  ) like

" function assumed not to throw an exception but does ; The function is extern "C" and /EHc was specified"

Example :

java.desktop/windows/native/libawt/java2d/windows/GDIRenderer.cpp

static POINT *TransformPoly()
  .....
    if (outpoints > POLYTEMPSIZE) {
        pPoints = (POINT *) SAFE_SIZE_ARRAY_ALLOC(safe_Malloc, sizeof(POINT), outpoints);
    }


Should  we add exception handling   here ?

Similar fixes were done  in the change  8039394: Compiler warnings about C++ exceptions in windows printing code

https://bugs.openjdk.java.net/browse/JDK-8039394
http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/823387e2bf42


Best regards, Matthias


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20180530/319c2ecf/attachment.html>


More information about the 2d-dev mailing list