Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
xdiff/xhistogram: factor out memory cleanup into free_index()
author
Stefan Beller
<sbeller@google.com>
Thu, 19 Jul 2018 18:56:19 +0000
(11:56 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 19 Jul 2018 19:46:01 +0000
(12:46 -0700)
This will be useful in the next patch as we'll introduce multiple
callers.
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
xdiff/xhistogram.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
2820985
)
diff --git
a/xdiff/xhistogram.c
b/xdiff/xhistogram.c
index 6e20f75fe85eb71c23dd60ad35419e531d9feb86..5098b6c5021f6b66ba9eb15c9021721dba2855e2 100644
(file)
--- a/
xdiff/xhistogram.c
+++ b/
xdiff/xhistogram.c
@@
-243,6
+243,14
@@
static int fall_back_to_classic_diff(xpparam_t const *xpp, xdfenv_t *env,
line1, count1, line2, count2);
}
line1, count1, line2, count2);
}
+static inline void free_index(struct histindex *index)
+{
+ xdl_free(index->records);
+ xdl_free(index->line_map);
+ xdl_free(index->next_ptrs);
+ xdl_cha_free(&index->rcha);
+}
+
static int find_lcs(struct histindex *index, struct region *lcs,
int line1, int count1, int line2, int count2) {
int b_ptr;
static int find_lcs(struct histindex *index, struct region *lcs,
int line1, int count1, int line2, int count2) {
int b_ptr;
@@
-343,10
+351,7
@@
static int histogram_diff(xpparam_t const *xpp, xdfenv_t *env,
}
cleanup:
}
cleanup:
- xdl_free(index.records);
- xdl_free(index.line_map);
- xdl_free(index.next_ptrs);
- xdl_cha_free(&index.rcha);
+ free_index(&index);
return result;
}
return result;
}