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 >>

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

2024-07-11 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

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

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

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

Re: RFR: 8334599: Improve code from JDK-8302671

2024-07-03 Thread Julian Waters
On Mon, 24 Jun 2024 20:43:00 GMT, Alexey Ivanov 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 >>

Re: RFR: 8334599: Improve code from JDK-8302671

2024-06-28 Thread Phil Race
On Fri, 28 Jun 2024 00:56:48 GMT, Julian Waters wrote: >> src/java.desktop/windows/native/libawt/windows/awt_Component.cpp line 3366: >> >>> 3364: static void >>> 3365: resetKbdState( BYTE ()[256]) { >>> 3366: BYTE tmpState[256]; >> >> Suggestion: >> >> resetKbdState( BYTE

Re: RFR: 8334599: Improve code from JDK-8302671

2024-06-27 Thread Julian Waters
On Mon, 24 Jun 2024 20:40:54 GMT, Alexey Ivanov wrote: > Will this resolve Phil's concern? Both arrays will use the same size. @prrace Does this address your concerns? If it does I will commit it - PR Review Comment: https://git.openjdk.org/jdk/pull/19798#discussion_r1657972007

Re: RFR: 8334599: Improve code from JDK-8302671

2024-06-24 Thread Alexey Ivanov
On Thu, 20 Jun 2024 08:29:39 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

2024-06-21 Thread Julian Waters
On Thu, 20 Jun 2024 08:29:39 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

2024-06-21 Thread Phil Race
On Thu, 20 Jun 2024 08:29:39 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

2024-06-20 Thread Julian Waters
On Thu, 20 Jun 2024 08:29:39 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

2024-06-20 Thread Phil Race
On Thu, 20 Jun 2024 08:29:39 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++,

RFR: 8334599: Improve code from JDK-8302671

2024-06-20 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 work