[Pkg-gnupg-commit] [gnupg2] 45/166: gpgscm: Tune the hash tables.
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Thu Mar 16 22:33:04 UTC 2017
This is an automated email from the git hooks/post-receive script.
dkg pushed a commit to branch experimental
in repository gnupg2.
commit 2e78aa6ff770849415f8eb71ca70c8886e9564c8
Author: Justus Winter <justus at g10code.com>
Date: Tue Jan 31 18:45:57 2017 +0100
gpgscm: Tune the hash tables.
* tests/gpgscm/scheme.c (oblist_initial_value): Increase the size of
the hash table based on the number of symbols used after initializing
the interpreter.
(new_frame_in_env): Increase the size of the hash table based on the
number of variables in the global environement.
Signed-off-by: Justus Winter <justus at g10code.com>
---
tests/gpgscm/scheme.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/tests/gpgscm/scheme.c b/tests/gpgscm/scheme.c
index c4af94d..1265c62 100644
--- a/tests/gpgscm/scheme.c
+++ b/tests/gpgscm/scheme.c
@@ -1073,7 +1073,9 @@ static int hash_fn(const char *key, int table_size);
static pointer oblist_initial_value(scheme *sc)
{
- return mk_vector(sc, 461); /* probably should be bigger */
+ /* There are about 768 symbols used after loading the
+ * interpreter. */
+ return mk_vector(sc, 1009);
}
/* Add a new symbol NAME at SLOT. SLOT must be obtained using
@@ -2642,9 +2644,9 @@ static void new_frame_in_env(scheme *sc, pointer old_env)
{
pointer new_frame;
- /* The interaction-environment has about 300 variables in it. */
+ /* The interaction-environment has about 480 variables in it. */
if (old_env == sc->NIL) {
- new_frame = mk_vector(sc, 461);
+ new_frame = mk_vector(sc, 751);
} else {
new_frame = sc->NIL;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git
More information about the Pkg-gnupg-commit
mailing list