diff options
author | René Scharfe <l.s.r@web.de> | 2022-07-16 19:54:51 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-07-18 01:20:38 +0300 |
commit | 318051eaeb1dbbd2acea1c0dcf9f4e8e8ef5d3a9 (patch) | |
tree | ded414dc0cc086ca0031f3fd44cf2af769ba7df0 /pack-revindex.c | |
parent | 848afebe5604877354bea42d81df380cff03b948 (diff) |
mergesort: add macros for typed sort of linked lists
Add the macros DECLARE_LIST_SORT and DEFINE_LIST_SORT for building
type-specific functions for sorting linked lists. The generated
function expects a typed comparison function.
The programmer provides full type information (no void pointers). This
allows the compiler to check whether the comparison function matches the
list type. It can also inline the "next" pointer accessor functions and
even the comparison function to get rid of the calling overhead.
Also provide a DECLARE_LIST_SORT_DEBUG macro that allows executing
custom code whenever the accessor functions are used. It's intended to
be used by test-mergesort, which counts these operations.
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack-revindex.c')
0 files changed, 0 insertions, 0 deletions