diff options
author | Elijah Newren <newren@gmail.com> | 2021-07-30 11:47:41 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-07-30 09:01:19 -0700 |
commit | a8791ef6492bf702ba70352009cbd28fb581c6e2 (patch) | |
tree | 069fb2c73de4a9df8c8f0b973169e60f151ccab3 /diffcore.h | |
parent | 6697ee01b5d31df5c83ace9eabb6285cf42ff172 (diff) | |
download | git-a8791ef6492bf702ba70352009cbd28fb581c6e2.tar.gz |
diffcore-rename, merge-ort: add wrapper functions for filepair alloc/dealloc
We want to be able to allocate filespecs and filepairs using a mem_pool.
However, filespec data will still remain outside the pool (perhaps in
the future we could plumb the pool through the various diff APIs to
allocate the filespec data too, but for now we are limiting the scope).
Add some extra functions to allocate these appropriately based on the
non-NULL-ness of opt->priv->pool, as well as some extra functions to
handle correctly deallocating the relevant parts of them. A future
commit will make use of these new functions.
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diffcore.h')
-rw-r--r-- | diffcore.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/diffcore.h b/diffcore.h index 533b30e21e..b58ee6b193 100644 --- a/diffcore.h +++ b/diffcore.h @@ -127,6 +127,8 @@ struct diff_filepair { #define DIFF_PAIR_MODE_CHANGED(p) ((p)->one->mode != (p)->two->mode) void diff_free_filepair(struct diff_filepair *); +void pool_diff_free_filepair(struct mem_pool *pool, + struct diff_filepair *p); int diff_unmodified_pair(struct diff_filepair *); |