Created
December 22, 2025 04:39
-
-
Save cjac/8897acbe66233f9d9e57f1abb32cd9fe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cjac@cjac:~/src/github/googlestaging/protobuf/perl-5.40.1$ git diff util.c | |
| diff --git a/util.c b/util.c | |
| index 4053ca4..e090bfb 100644 | |
| --- a/util.c | |
| +++ b/util.c | |
| @@ -156,7 +156,13 @@ Perl_safesysmalloc(MEM_SIZE size) | |
| abort(); | |
| } | |
| #else | |
| +#undef fprintf | |
| +#undef stderr | |
| + fprintf(stderr, "[MEM_TRACE] Perl_safesysmalloc: About to malloc %zu bytes\n", size); | |
| ptr = (Malloc_t)PerlMem_malloc(size); | |
| + fprintf(stderr, "[MEM_TRACE] Perl_safesysmalloc: Malloc'd %zu bytes, ptr = %p\n", size, ptr); | |
| +#define fprintf _CANNOT _fprintf_ | |
| +#define stderr _CANNOT _stderr_ | |
| #endif | |
| PERL_ALLOC_CHECK(ptr); | |
| if (ptr != NULL) { | |
| @@ -287,7 +293,13 @@ Perl_safesysrealloc(Malloc_t where,MEM_SIZE size) | |
| abort(); | |
| } | |
| #else | |
| +#undef fprintf | |
| +#undef stderr | |
| + fprintf(stderr, "[MEM_TRACE] Perl_safesysrealloc: About to realloc %p to %zu bytes\n", where, size); | |
| ptr = (Malloc_t)PerlMem_realloc(where,size); | |
| + fprintf(stderr, "[MEM_TRACE] Perl_safesysrealloc: Realloc'd %p to %p, %zu bytes\n", where, ptr, size); | |
| +#define fprintf _CANNOT _fprintf_ | |
| +#define stderr _CANNOT _stderr_ | |
| #endif | |
| PERL_ALLOC_CHECK(ptr); | |
| @@ -413,7 +425,13 @@ Perl_safesysfree(Malloc_t where) | |
| Malloc_t where_intrn = where; | |
| #endif /* USE_MDH */ | |
| #ifndef PERL_DEBUG_READONLY_COW | |
| +#undef fprintf | |
| +#undef stderr | |
| + fprintf(stderr, "[MEM_TRACE] Perl_safesysfree: About to free %p\n", where_intrn); | |
| PerlMem_free(where_intrn); | |
| + fprintf(stderr, "[MEM_TRACE] Perl_safesysfree: Freed %p\n", where_intrn); | |
| +#define fprintf _CANNOT _fprintf_ | |
| +#define stderr _CANNOT _stderr_ | |
| #endif | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment