diff options
author | Justus Winter <[email protected]> | 2017-01-31 17:45:57 +0000 |
---|---|---|
committer | Justus Winter <[email protected]> | 2017-01-31 17:49:27 +0000 |
commit | 2e78aa6ff770849415f8eb71ca70c8886e9564c8 (patch) | |
tree | 188a0244fb4cc23842acf43c42293775ea43047b /tests/gpgscm/scheme.c | |
parent | gpgscm: Optimize environment lookups and insertions. (diff) | |
download | gnupg-2e78aa6ff770849415f8eb71ca70c8886e9564c8.tar.gz gnupg-2e78aa6ff770849415f8eb71ca70c8886e9564c8.zip |
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 <[email protected]>
Diffstat (limited to 'tests/gpgscm/scheme.c')
-rw-r--r-- | tests/gpgscm/scheme.c | 8 |
1 files 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; } |