From 2e78aa6ff770849415f8eb71ca70c8886e9564c8 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Tue, 31 Jan 2017 18:45:57 +0100 Subject: [PATCH] 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 --- 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 c4af94d74..1265c62c0 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; }