@@ -690,7 +690,6 @@ static void path_msg(struct merge_options *opt,
690
690
strbuf_addch (sb , '\n' );
691
691
}
692
692
693
- MAYBE_UNUSED
694
693
static struct diff_filespec * pool_alloc_filespec (struct mem_pool * pool ,
695
694
const char * path )
696
695
{
@@ -712,7 +711,6 @@ static struct diff_filespec *pool_alloc_filespec(struct mem_pool *pool,
712
711
return spec ;
713
712
}
714
713
715
- MAYBE_UNUSED
716
714
static struct diff_filepair * pool_diff_queue (struct mem_pool * pool ,
717
715
struct diff_queue_struct * queue ,
718
716
struct diff_filespec * one ,
@@ -930,6 +928,7 @@ static void add_pair(struct merge_options *opt,
930
928
unsigned dir_rename_mask )
931
929
{
932
930
struct diff_filespec * one , * two ;
931
+ struct mem_pool * pool = opt -> priv -> pool ;
933
932
struct rename_info * renames = & opt -> priv -> renames ;
934
933
int names_idx = is_add ? side : 0 ;
935
934
@@ -980,11 +979,11 @@ static void add_pair(struct merge_options *opt,
980
979
return ;
981
980
}
982
981
983
- one = alloc_filespec ( pathname );
984
- two = alloc_filespec ( pathname );
982
+ one = pool_alloc_filespec ( pool , pathname );
983
+ two = pool_alloc_filespec ( pool , pathname );
985
984
fill_filespec (is_add ? two : one ,
986
985
& names [names_idx ].oid , 1 , names [names_idx ].mode );
987
- diff_queue ( & renames -> pairs [side ], one , two );
986
+ pool_diff_queue ( pool , & renames -> pairs [side ], one , two );
988
987
}
989
988
990
989
static void collect_rename_info (struct merge_options * opt ,
@@ -2893,6 +2892,7 @@ static void use_cached_pairs(struct merge_options *opt,
2893
2892
{
2894
2893
struct hashmap_iter iter ;
2895
2894
struct strmap_entry * entry ;
2895
+ struct mem_pool * pool = opt -> priv -> pool ;
2896
2896
2897
2897
/*
2898
2898
* Add to side_pairs all entries from renames->cached_pairs[side_index].
@@ -2906,9 +2906,9 @@ static void use_cached_pairs(struct merge_options *opt,
2906
2906
new_name = old_name ;
2907
2907
2908
2908
/* We don't care about oid/mode, only filenames and status */
2909
- one = alloc_filespec ( old_name );
2910
- two = alloc_filespec ( new_name );
2911
- diff_queue ( pairs , one , two );
2909
+ one = pool_alloc_filespec ( pool , old_name );
2910
+ two = pool_alloc_filespec ( pool , new_name );
2911
+ pool_diff_queue ( pool , pairs , one , two );
2912
2912
pairs -> queue [pairs -> nr - 1 ]-> status = entry -> value ? 'R' : 'D' ;
2913
2913
}
2914
2914
}
@@ -3016,6 +3016,7 @@ static int detect_regular_renames(struct merge_options *opt,
3016
3016
diff_queued_diff = renames -> pairs [side_index ];
3017
3017
trace2_region_enter ("diff" , "diffcore_rename" , opt -> repo );
3018
3018
diffcore_rename_extended (& diff_opts ,
3019
+ opt -> priv -> pool ,
3019
3020
& renames -> relevant_sources [side_index ],
3020
3021
& renames -> dirs_removed [side_index ],
3021
3022
& renames -> dir_rename_count [side_index ],
@@ -3066,7 +3067,7 @@ static int collect_renames(struct merge_options *opt,
3066
3067
3067
3068
if (p -> status != 'A' && p -> status != 'R' ) {
3068
3069
possibly_cache_new_pair (renames , p , side_index , NULL );
3069
- diff_free_filepair ( p );
3070
+ pool_diff_free_filepair ( opt -> priv -> pool , p );
3070
3071
continue ;
3071
3072
}
3072
3073
@@ -3079,7 +3080,7 @@ static int collect_renames(struct merge_options *opt,
3079
3080
3080
3081
possibly_cache_new_pair (renames , p , side_index , new_path );
3081
3082
if (p -> status != 'R' && !new_path ) {
3082
- diff_free_filepair ( p );
3083
+ pool_diff_free_filepair ( opt -> priv -> pool , p );
3083
3084
continue ;
3084
3085
}
3085
3086
@@ -3197,7 +3198,7 @@ static int detect_and_process_renames(struct merge_options *opt,
3197
3198
side_pairs = & renames -> pairs [s ];
3198
3199
for (i = 0 ; i < side_pairs -> nr ; ++ i ) {
3199
3200
struct diff_filepair * p = side_pairs -> queue [i ];
3200
- diff_free_filepair ( p );
3201
+ pool_diff_free_filepair ( opt -> priv -> pool , p );
3201
3202
}
3202
3203
}
3203
3204
@@ -3210,7 +3211,8 @@ static int detect_and_process_renames(struct merge_options *opt,
3210
3211
if (combined .nr ) {
3211
3212
int i ;
3212
3213
for (i = 0 ; i < combined .nr ; i ++ )
3213
- diff_free_filepair (combined .queue [i ]);
3214
+ pool_diff_free_filepair (opt -> priv -> pool ,
3215
+ combined .queue [i ]);
3214
3216
free (combined .queue );
3215
3217
}
3216
3218
0 commit comments