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

Re: Patch: reducing code duplication by using functions

From: Oto BREZINA <otik_at_e-posta.sk>
Date: Mon, 31 Aug 2009 23:56:27 +0200

Dear Stefan,

Thanks for your time and answers.

On 2009-08-31 21:33, Stefan Küng wrote:
> On 31.08.2009 11:49, Oto BREZINA wrote:
>
>> 1.*ptr != buffer*// according some rule we (in our company - not TSVN) use comparing pointers is classified as not safe
> It's safe if done right. It's just easy to mess it up.
>
Ok. Comparision of local pointers is safe, but ... I don't like it ;)
I just remmember time when two different pointers can point to same
place. As I understand this possible also now days when pointers are
just pointers to maps of lacation but don't know must about.
This usage is 100% correct anyway.

There are lot discussion about NULL vs 0. Comparing pointers may be
similar story so I stop here.

>
>> 2. using ptr[i] is faster anyway - according intel optimazition manual (at least as i remmember)
>>
>
> I though pointer arithmetic was faster - but I guess with todays
> optimizing compilers it won't make a difference.
>
I will do some test to check it, but as I rememeber it comes from
internal cache mechanizm. So not sure if compiler is able to do such
optimalization.
Also according that paper (I should probably reread it) decrementing of
pointer takes more time - because of cache.

Oto
> Stefan
>

------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=757&dsMessageId=2389558

To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2009-09-01 02:26:19 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.