Re: RFR: 8334599: Improve code from JDK-8302671 [v2]

2024-07-22 Thread Alexey Ivanov
On Thu, 11 Jul 2024 08:36:23 GMT, Julian Waters wrote: >> src/java.desktop/windows/native/libawt/windows/awt_Component.cpp line 3365: >> >>> 3363: } >>> 3364: static void >>> 3365: resetKbdState(BYTE (&kstate) [AwtToolkit::KB_STATE_SIZE]) { >> >> I don't know what is most used syntax for this t

Re: RFR: 8334599: Improve code from JDK-8302671 [v2]

2024-07-22 Thread Alexey Ivanov
On Thu, 11 Jul 2024 08:36:54 GMT, Julian Waters wrote: >> src/java.desktop/windows/native/libawt/windows/awt_Component.cpp line 3368: >> >>> 3366: BYTE tmpState[AwtToolkit::KB_STATE_SIZE]; >>> 3367: WCHAR wc[2]; >>> 3368: memmove(tmpState, kstate, sizeof (kstate)); >> >> Suggestion:

Re: RFR: 8334599: Improve code from JDK-8302671 [v2]

2024-07-11 Thread Julian Waters
On Thu, 4 Jul 2024 12:59:48 GMT, Alexey Ivanov wrote: >> Julian Waters has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains five additional >> commit

Re: RFR: 8334599: Improve code from JDK-8302671 [v2]

2024-07-09 Thread Phil Race
On Wed, 3 Jul 2024 13:34:38 GMT, Julian Waters wrote: >> In [JDK-8302671](https://bugs.openjdk.org/browse/JDK-8302671) I fixed a >> memmove decay bug by rewriting a sizeof on an array to an explicit size of >> 256, but this is a bit of a band aid fix. It's come to my attention that in >> C++,

Re: RFR: 8334599: Improve code from JDK-8302671 [v2]

2024-07-04 Thread Alexey Ivanov
On Thu, 4 Jul 2024 13:15:28 GMT, Thomas Stuefe wrote: > Using memmove is so uncommon that it is usually a clear indication for a > deliberate choice. It may still be an accidental choice. I didn't find any code review for [JDK-6680988](https://bugs.openjdk.org/browse/JDK-6680988) where this li

Re: RFR: 8334599: Improve code from JDK-8302671 [v2]

2024-07-04 Thread Alexey Ivanov
On Wed, 3 Jul 2024 13:34:38 GMT, Julian Waters wrote: >> In [JDK-8302671](https://bugs.openjdk.org/browse/JDK-8302671) I fixed a >> memmove decay bug by rewriting a sizeof on an array to an explicit size of >> 256, but this is a bit of a band aid fix. It's come to my attention that in >> C++,

Re: RFR: 8334599: Improve code from JDK-8302671 [v2]

2024-07-04 Thread Thomas Stuefe
On Wed, 3 Jul 2024 13:34:38 GMT, Julian Waters wrote: >> In [JDK-8302671](https://bugs.openjdk.org/browse/JDK-8302671) I fixed a >> memmove decay bug by rewriting a sizeof on an array to an explicit size of >> 256, but this is a bit of a band aid fix. It's come to my attention that in >> C++,

Re: RFR: 8334599: Improve code from JDK-8302671 [v2]

2024-07-04 Thread Alexey Ivanov
On Wed, 3 Jul 2024 13:25:27 GMT, Julian Waters wrote: >> src/java.desktop/windows/native/libawt/windows/awt_Component.cpp line 3368: >> >>> 3366: BYTE tmpState[256]; >>> 3367: WCHAR wc[2]; >>> 3368: memmove(tmpState, kstate, sizeof(kstate)); >> >> Using `memcpy` could be more perfor

Re: RFR: 8334599: Improve code from JDK-8302671 [v2]

2024-07-03 Thread Julian Waters
> In [JDK-8302671](https://bugs.openjdk.org/browse/JDK-8302671) I fixed a > memmove decay bug by rewriting a sizeof on an array to an explicit size of > 256, but this is a bit of a band aid fix. It's come to my attention that in > C++, one can pass an array by reference, which causes sizeof to w