On Wed, 28 Oct 2026 14:36:14 GMT, Alexey Ushakov <[email protected]> wrote:

>> Yeah I agree, we can do this. Any idea what do to then in case of 
>> alloc-failure in the StoreFixedLine function? Just return early? Or change 
>> the function from void to some other return type to indicate failure/success 
>> ?
>> Do you maybe already have some good example in the java2d C code I can use 
>> here too?
>
> I suppose we could add one more field to the ProcessHandler structure.
> `typedef struct _ProcessHandler {`
> `...`
> `jint resultCode; // 0 - OK , 1 - Allocation error, ...`
> `...`
> `} ProcessHandler;`
> 
> Then use it in the ProcessPath() main loop to exit with JNI_FALSE on error.  
> The check could be inserted at the end of the loop, so we fail right after 
> processing some segment in the path.

Hi @avu , I added the resultCode as suggested. Please check.
(I also added a little comment to maybe use/check the resultCode earlier than 
now - where exactly in the for loop in ProcessPath() should I do it? Or keep it 
as it is ?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/33513#discussion_r4414895160

Reply via email to