[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdevelop-devel
Subject:    Re: Nonportable code in C++ support
From:       Matthew Woehlke <mw_triad () users ! sourceforge ! net>
Date:       2008-02-15 19:14:15
Message-ID: fp4oa8$uj3$1 () ger ! gmane ! org
[Download RAW message or body]

Esben Mose Hansen wrote:
> It wouldn't break. It's a hash function, it's going to get moduloed with some 
> smallish number anyway. The hash function just need a reasonable chance to 
> get different results for different pointers, fast. The latter is the reason 
> why I wouldn't bitshift it with size_t, even though those bits would likely 
> nearly always be zero.

Isn't this a *really* good reason to strip the last couple bits? I.e. 
because otherwise with a small table you will *always* get collisions 
due to the last 2-4 bits always being 0?

Seriously, how long does a bit-shift operation take? It's measured in 
single-digit /cycles/ after all... It's measurable compared to the cost 
of calling the hash function, but not compared to much else.

-- 
Matthew
A pool hall put up a sign in their front window that read: "Profound 
language prohibited within." I could just imagine some people discussing 
the meaning of life and being told to take it outside. -- Scott Adams


_______________________________________________
KDevelop-devel mailing list
KDevelop-devel@kdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic