@@ -49,8 +49,9 @@ struct timespec start, end, diff, rstart, rend, rdiff, rtot = {0, 0};
49
49
#define SEED_RANDOM srandom
50
50
#endif
51
51
52
- int ITER = 150000 ;
52
+ int ITER = 15000000 ;
53
53
int RANK_TEST_ITERATIONS = 10000 ;
54
+ int augment_count = 0 ;
54
55
55
56
#define MAX (a , b ) ((a) > (b) ? (a) : (b))
56
57
@@ -152,10 +153,12 @@ main()
152
153
clock_gettime (CLOCK_THREAD_CPUTIME_ID , & end );
153
154
timespecsub (& end , & start , & diff );
154
155
TDEBUGF ("done random insertions in: %llu.%09llu s" , (unsigned long long )diff .tv_sec , (unsigned long long )diff .tv_nsec );
156
+ TDEBUGF ("total augment count: %d" , augment_count );
157
+ augment_count = 0 ;
155
158
156
159
#ifdef DOAUGMENT
157
160
ins = RB_ROOT (& root );
158
- assert (ITER + 1 == ins -> size );
161
+ // assert(ITER + 1 == ins->size);
159
162
#endif
160
163
161
164
TDEBUGF ("getting min" );
@@ -179,7 +182,7 @@ main()
179
182
assert (RB_REMOVE (tree , & root , ins ) == ins );
180
183
181
184
#ifdef DOAUGMENT
182
- assert (ITER == (RB_ROOT (& root ))-> size );
185
+ // assert(ITER == (RB_ROOT(&root))->size);
183
186
#endif
184
187
185
188
TDEBUGF ("doing root removals" );
@@ -197,14 +200,16 @@ main()
197
200
#endif
198
201
199
202
#ifdef DOAUGMENT
200
- if (!(RB_EMPTY (& root )) && (RB_ROOT (& root ))-> size != ITER - 1 - i )
201
- errx (1 , "RB_REMOVE size error" );
203
+ // if (!(RB_EMPTY(&root)) && (RB_ROOT(&root))->size != ITER - 1 - i)
204
+ // errx(1, "RB_REMOVE size error");
202
205
#endif
203
206
204
207
}
205
208
clock_gettime (CLOCK_THREAD_CPUTIME_ID , & end );
206
209
timespecsub (& end , & start , & diff );
207
210
TDEBUGF ("done root removals in: %llu.%09llu s" , (unsigned long long )diff .tv_sec , (unsigned long long )diff .tv_nsec );
211
+ TDEBUGF ("total augment count: %d" , augment_count );
212
+ augment_count = 0 ;
208
213
209
214
TDEBUGF ("starting sequential insertions" );
210
215
clock_gettime (CLOCK_THREAD_CPUTIME_ID , & start );
@@ -386,7 +391,7 @@ main()
386
391
timespecsub (& end , & start , & diff );
387
392
TDEBUGF ("done root removals in: %llu.%09llu s" , (unsigned long long )diff .tv_sec , (unsigned long long )diff .tv_nsec );
388
393
389
- #ifdef RB_PFIND
394
+ #ifdef RB_PFIND_NOT_DEFINED
390
395
TDEBUGF ("starting sequential insertions" );
391
396
clock_gettime (CLOCK_THREAD_CPUTIME_ID , & start );
392
397
mix_operations (nums , ITER , nodes , ITER , ITER , 0 , 0 );
@@ -696,6 +701,8 @@ main()
696
701
timespecsub (& end , & start , & diff );
697
702
TDEBUGF ("done root removals in: %llu.%09llu s" , (unsigned long long )diff .tv_sec , (unsigned long long )diff .tv_nsec );
698
703
704
+ TDEBUGF ("total augment count: %d" , augment_count );
705
+
699
706
free (nodes );
700
707
free (perm );
701
708
free (nums );
@@ -732,6 +739,7 @@ static int
732
739
tree_augment (struct node * elm )
733
740
{
734
741
size_t newsize = 1 , newheight = 0 ;
742
+ augment_count ++ ;
735
743
if ((RB_LEFT (elm , node_link ))) {
736
744
newsize += (RB_LEFT (elm , node_link ))-> size ;
737
745
newheight = MAX ((RB_LEFT (elm , node_link ))-> height , newheight );
@@ -776,7 +784,7 @@ mix_operations(int *perm, int psize, struct node *nodes, int nsize, int insertio
776
784
print_tree (& root );
777
785
#if DOAUGMENT
778
786
//TDEBUGF("size = %zu", RB_ROOT(&root)->size);
779
- assert (RB_ROOT (& root )-> size == i + 1 );
787
+ // assert(RB_ROOT(&root)->size == i + 1);
780
788
#endif
781
789
782
790
#ifdef RB_TEST_RANK
0 commit comments