RFR 8074067: Cleanup in java.base/share/native/libjava/Bits.c
Alan Bateman
Alan.Bateman at oracle.com
Mon Mar 2 15:46:24 UTC 2015
On 01/03/2015 15:20, Ivan Gerasimov wrote:
> Hello everyone!
>
> Code in the file Bits.c can be made a bit shorter:
> First, we can remove updating the variables which aren't used:
> 103 dstAddr += size;
> 138 srcAddr += size;
> ... and alike.
>
> Second, the 'size' variable may only be updated when 'length' becomes
> less than MBYTE.
> The warning not to modify the code which has just been modified was
> also removed.
>
> I've built jdk on all available platforms (both production and debug)
> to make sure the code is still compilable.
>
> BUGURL: https://bugs.openjdk.java.net/browse/JDK-8074067
> WEBREV: http://cr.openjdk.java.net/~igerasim/8074067/0/webrev/
As you've noted, there is no need to update xxxAddr because the position
is updated during swapping copy. That looks okay to me.
Only updating size for the last chunk is okay too, but that a bit of
coin toss as to whether to change this as the current code is easy to
read. The stale comment should be removed of course.
-Alan.
More information about the core-libs-dev
mailing list