Re: RFR: JDK-8298170 : Introduce a macro for exception check, free and return

2022-12-28 Thread Matthias Baesken
On Tue, 6 Dec 2022 15:20:26 GMT, Matthias Baesken wrote: > We have a number of places in the codebase where a macro could help when we > check an exception and afterwrads free something and return. okay, if keeping the block in the code that contains free and return, we probably just stay

Re: RFR: JDK-8298170 : Introduce a macro for exception check, free and return

2022-12-09 Thread Roger Riggs
On Fri, 9 Dec 2022 12:23:04 GMT, Matthias Baesken wrote: > Hi Roger , the new proposed version JNU_CHECK_EXCEPTION_DO is now almost as > lengthy as the original coding, Is it really worth it introducing a macro > when it gets so lengthy ? Its easier to understand the flow and cleanup being

Re: RFR: JDK-8298170 : Introduce a macro for exception check, free and return

2022-12-09 Thread Matthias Baesken
On Tue, 6 Dec 2022 15:20:26 GMT, Matthias Baesken wrote: > We have a number of places in the codebase where a macro could help when we > check an exception and afterwrads free something and return. Hi Roger , the new proposed version JNU_CHECK_EXCEPTION_DO is now almost as lengthy as the

Re: RFR: JDK-8298170 : Introduce a macro for exception check, free and return

2022-12-07 Thread Thomas Stuefe
On Wed, 7 Dec 2022 16:27:43 GMT, Roger Riggs wrote: > > Good idea, though perhaps the return (and value if any) could be explicit in > the macro invocation, instead of implicit (plus arg). A single macro would > suffice, instead of multiples. > > Usage Example: > > ``` >

Re: RFR: JDK-8298170 : Introduce a macro for exception check, free and return

2022-12-07 Thread Roger Riggs
On Tue, 6 Dec 2022 15:20:26 GMT, Matthias Baesken wrote: > We have a number of places in the codebase where a macro could help when we > check an exception and afterwrads free something and return. Good idea, though perhaps the return (and value if any) could be explicit in the macro

Re: RFR: JDK-8298170 : Introduce a macro for exception check, free and return

2022-12-07 Thread Matthias Baesken
On Tue, 6 Dec 2022 20:40:34 GMT, Roger Riggs wrote: > The existing code more obviously handles memory deallocation. Thomas Stuefe suggested something like this JNU_CHECK_EXCEPTION_DO(env, action) JNU_CHECK_EXCEPTION_DO_AND_RETURN(env, action, retval) usage example:

Re: RFR: JDK-8298170 : Introduce a macro for exception check, free and return

2022-12-06 Thread Roger Riggs
On Tue, 6 Dec 2022 15:20:26 GMT, Matthias Baesken wrote: > We have a number of places in the codebase where a macro could help when we > check an exception and afterwrads free something and return. The existing (and new) macro naming doesn't make clear that it always returns from the

Re: RFR: JDK-8298170 : Introduce a macro for exception check, free and return

2022-12-06 Thread Phil Race
On Tue, 6 Dec 2022 15:20:26 GMT, Matthias Baesken wrote: > We have a number of places in the codebase where a macro could help when we > check an exception and afterwrads free something and return. I'm OK with the idea and the specific desktop change. I'll leave the rest to the appropriate

RFR: JDK-8298170 : Introduce a macro for exception check, free and return

2022-12-06 Thread Matthias Baesken
We have a number of places in the codebase where a macro could help when we check an exception and afterwrads free something and return. - Commit messages: - JDK-8298170 Changes: https://git.openjdk.org/jdk/pull/11539/files Webrev: https://webrevs.openjdk.org/?repo=jdk=11539=00