grep/pcre2: prepare to add debugging to pcre2_malloc()
Change pcre2_malloc() in a way that'll make it easier for a debugging fprintf() to spew out the allocated pointer. This doesn't introduce any functional change, it just makes a subsequent commit's diff easier to read. Changes code added in 513f2b0bbd4 (grep: make PCRE2 aware of custom allocator, 2019-10-16). Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ævar Arnfjörð Bjarmason committed
Feb 18, 2021 at 01:07 UTC
588e4fb19190c03319a2b67d447dd40f97d85531
1 file changed
+2
-1
grep.c
+2
-1
@@ -45,7 +45,8 @@ static pcre2_general_context *pcre2_global_context;
45
46
static void *pcre2_malloc(PCRE2_SIZE size, MAYBE_UNUSED void *memory_data)
47
{
48
- return malloc(size);
48
+ void *pointer = malloc(size);
49
+ return pointer;
50
}
51
52
static void pcre2_free(void *pointer, MAYBE_UNUSED void *memory_data)