[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: JavaHL bug in native code?

From: Hyrum K Wright <hyrum.wright_at_wandisco.com>
Date: Wed, 21 Dec 2011 08:29:18 -0600

On Tue, Dec 20, 2011 at 1:42 PM, Philip Martin
<philip.martin_at_wandisco.com> wrote:
> Mark Phippard <markphip_at_gmail.com> writes:
>
>> We have had a few users report a weird error that looks like they are
>> getting an ArrayIndexOutOfBoundsException except that it appears that
>> it is coming out of the native code.  This happens during an update
>> operation.  I am going to paste some of the native code in here, in
>> case anyone sees anything in the array handling that looks wrong.  The
>> use of ++i instead of i++ looks odd to me, but I am not a C++
>> programmer and the general code patterns.
>
> ++i and i++ are equivalent in this case, and likely to be identical
> after optimisation.

More generally, the prefix-increment/decrement operation is more
efficient on some data types, namely iterators. While it may not
matter in the above case, a typical C++ pattern is to use the prefix
version to account for the cases when it does.

-Hyrum

-- 
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com/
Received on 2011-12-21 15:29:50 CET

This is an archived mail posted to the Subversion Dev mailing list.