From: Philip Herron <herron.philip@googlemail.com>
To: git@vger.kernel.org
Subject: Hash Tables
Date: Thu, 06 Aug 2009 05:35:40 +0100 [thread overview]
Message-ID: <4A7A5D9C.7000604@googlemail.com> (raw)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hey guys
This is my first time posting to git mailing-list didn't get much
response from irc.
I've been loving git and just been poking at its hash tables in
hash.{c,h}, which are very nice. I've been implementing my own hash
tables and i have some questions on how you guys done it.
1 - Are you using the sha1.c as your hashing function? And why did you
choose it, I have been playing with a few different ones to see how it
goes.
2 -table lookup i see your hash_table has an unsigned int nr, not
quite sure what that is for num_remaing or something is what i
first thought.
But i see in your table lookup you use hash % size and it returns
an index to the array. And would love to know how that works.
Is size the current number of hash entries in the table?
3 - what is the initial table size as in when you first insert an
entry into the table, the array must be allocated to a
length, and you grow when you reach a threshold.
Anyways thanks!
- --Phil
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkp6XZsACgkQAhcOgIaQQ2HWGgCfU6l909k7/JK3gf6BB2Cu35xB
jBIAn2Jl6UWp5ZvTXJxUWc91tgn//z25
=6l91
-----END PGP SIGNATURE-----
next reply other threads:[~2009-08-06 4:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-06 4:35 Philip Herron [this message]
2009-08-06 5:17 ` Hash Tables Philip Herron
2009-08-06 8:53 ` Thomas Rast
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A7A5D9C.7000604@googlemail.com \
--to=herron.philip@googlemail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.