Date: Wed, 17 Dec 2003 13:09:18 -0500 (EST) From: Ted Unangst <tedu@zeitbombe.org> Cc: freebsd-hackers@freebsd.org Subject: Re: patch: portable dirhash Message-ID: <Pine.BSO.4.58.0312171301380.17560@af.pbqrshfvbavf.pbz> In-Reply-To: <Pine.NEB.3.96L.1031217105921.26359F-100000@fledge.watson.org> References: <Pine.NEB.3.96L.1031217105921.26359F-100000@fledge.watson.org>
next in thread | previous in thread | raw e-mail | index | archive | help
while on the subject, there's a piece of code something like this in freebsd: /* * We hash the name and then some other bit of data that is * invariant over the dirhash's lifetime. Otherwise names * differing only in the last byte are placed close to one * another in the table, which is bad for linear probing. */ hash = hash32_buf(name, namelen, HASHINIT); hash = hash32_buf(dh, sizeof(dh), hash); which isn't doing what you'd expect (hashing the dh pointer), instead it hashes the first bytes of dh, conveniently a constant value so it works, but it provides no benefit. fix is making it &dh. i'd provide a diff, but it's a little large. :) -- all we're waiting for is for something worth waiting for
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSO.4.58.0312171301380.17560>