1- #define USE_THE_INDEX_VARIABLE
21#include "test-tool.h"
32#include "environment.h"
43#include "name-hash.h"
@@ -40,22 +39,22 @@ static void dump_run(void)
4039
4140 repo_read_index (the_repository );
4241 if (single ) {
43- test_lazy_init_name_hash (& the_index , 0 );
42+ test_lazy_init_name_hash (the_repository -> index , 0 );
4443 } else {
45- int nr_threads_used = test_lazy_init_name_hash (& the_index , 1 );
44+ int nr_threads_used = test_lazy_init_name_hash (the_repository -> index , 1 );
4645 if (!nr_threads_used )
4746 die ("non-threaded code path used" );
4847 }
4948
50- hashmap_for_each_entry (& the_index . dir_hash , & iter_dir , dir ,
49+ hashmap_for_each_entry (& the_repository -> index -> dir_hash , & iter_dir , dir ,
5150 ent /* member name */ )
5251 printf ("dir %08x %7d %s\n" , dir -> ent .hash , dir -> nr , dir -> name );
5352
54- hashmap_for_each_entry (& the_index . name_hash , & iter_cache , ce ,
53+ hashmap_for_each_entry (& the_repository -> index -> name_hash , & iter_cache , ce ,
5554 ent /* member name */ )
5655 printf ("name %08x %s\n" , ce -> ent .hash , ce -> name );
5756
58- discard_index (& the_index );
57+ discard_index (the_repository -> index );
5958}
6059
6160/*
@@ -74,7 +73,7 @@ static uint64_t time_runs(int try_threaded)
7473 t0 = getnanotime ();
7574 repo_read_index (the_repository );
7675 t1 = getnanotime ();
77- nr_threads_used = test_lazy_init_name_hash (& the_index , try_threaded );
76+ nr_threads_used = test_lazy_init_name_hash (the_repository -> index , try_threaded );
7877 t2 = getnanotime ();
7978
8079 sum += (t2 - t1 );
@@ -86,16 +85,16 @@ static uint64_t time_runs(int try_threaded)
8685 printf ("%f %f %d multi %d\n" ,
8786 ((double )(t1 - t0 ))/1000000000 ,
8887 ((double )(t2 - t1 ))/1000000000 ,
89- the_index . cache_nr ,
88+ the_repository -> index -> cache_nr ,
9089 nr_threads_used );
9190 else
9291 printf ("%f %f %d single\n" ,
9392 ((double )(t1 - t0 ))/1000000000 ,
9493 ((double )(t2 - t1 ))/1000000000 ,
95- the_index . cache_nr );
94+ the_repository -> index -> cache_nr );
9695 fflush (stdout );
9796
98- discard_index (& the_index );
97+ discard_index (the_repository -> index );
9998 }
10099
101100 avg = sum / count ;
@@ -120,8 +119,8 @@ static void analyze_run(void)
120119 int nr ;
121120
122121 repo_read_index (the_repository );
123- cache_nr_limit = the_index . cache_nr ;
124- discard_index (& the_index );
122+ cache_nr_limit = the_repository -> index -> cache_nr ;
123+ discard_index (the_repository -> index );
125124
126125 nr = analyze ;
127126 while (1 ) {
@@ -135,22 +134,22 @@ static void analyze_run(void)
135134
136135 for (i = 0 ; i < count ; i ++ ) {
137136 repo_read_index (the_repository );
138- the_index . cache_nr = nr ; /* cheap truncate of index */
137+ the_repository -> index -> cache_nr = nr ; /* cheap truncate of index */
139138 t1s = getnanotime ();
140- test_lazy_init_name_hash (& the_index , 0 );
139+ test_lazy_init_name_hash (the_repository -> index , 0 );
141140 t2s = getnanotime ();
142141 sum_single += (t2s - t1s );
143- the_index . cache_nr = cache_nr_limit ;
144- discard_index (& the_index );
142+ the_repository -> index -> cache_nr = cache_nr_limit ;
143+ discard_index (the_repository -> index );
145144
146145 repo_read_index (the_repository );
147- the_index . cache_nr = nr ; /* cheap truncate of index */
146+ the_repository -> index -> cache_nr = nr ; /* cheap truncate of index */
148147 t1m = getnanotime ();
149- nr_threads_used = test_lazy_init_name_hash (& the_index , 1 );
148+ nr_threads_used = test_lazy_init_name_hash (the_repository -> index , 1 );
150149 t2m = getnanotime ();
151150 sum_multi += (t2m - t1m );
152- the_index . cache_nr = cache_nr_limit ;
153- discard_index (& the_index );
151+ the_repository -> index -> cache_nr = cache_nr_limit ;
152+ discard_index (the_repository -> index );
154153
155154 if (!nr_threads_used )
156155 printf (" [size %8d] [single %f] non-threaded code path used\n" ,
0 commit comments