#ifdef PERL_MEM_LOG
Malloc_t
-Perl_mem_log_alloc(const UV n, const UV typesize, const char *typename, Malloc_t newalloc, const char *filename, const int linenumber)
+Perl_mem_log_alloc(const UV n, const UV typesize, const char *typename, Malloc_t newalloc, const char *filename, const int linenumber, const char *funcname)
{
#ifdef PERL_MEM_LOG_STDERR
/* We can't use PerlIO_printf() for obvious reasons. */
char buf[1024];
sprintf(buf,
- "alloc: %s:%d: %"IVdf" %"UVuf" %s = %"IVdf": %p\n",
- filename, linenumber,
- n, typesize, typename, n * typesize, newalloc);
+ "alloc: %s:%d:%s: %"IVdf" %"UVuf" %s = %"IVdf": %"UVxf"\n",
+ filename, linenumber, funcname,
+ n, typesize, typename, n * typesize, PTR2UV(newalloc));
write(2, buf, strlen(buf));
#endif
return newalloc;
}
Malloc_t
-Perl_mem_log_realloc(const UV n, const UV typesize, const char *typename, Malloc_t oldalloc, Malloc_t newalloc, const char *filename, const int linenumber)
+Perl_mem_log_realloc(const UV n, const UV typesize, const char *typename, Malloc_t oldalloc, Malloc_t newalloc, const char *filename, const int linenumber, const char *funcname)
{
#ifdef PERL_MEM_LOG_STDERR
/* We can't use PerlIO_printf() for obvious reasons. */
char buf[1024];
sprintf(buf,
- "realloc: %s:%d: %"IVdf" %"UVuf" %s = %"IVdf": %p -> %p\n",
- filename, linenumber,
- n, typesize, typename, n * typesize, oldalloc, newalloc);
+ "realloc: %s:%d:%s: %"IVdf" %"UVuf" %s = %"IVdf": %"UVxf" -> %"UVxf"\n",
+ filename, linenumber, funcname,
+ n, typesize, typename, n * typesize, PTR2UV(oldalloc), PTR2UV(newalloc));
write(2, buf, strlen(buf));
#endif
return newalloc;
}
Malloc_t
-Perl_mem_log_free(Malloc_t oldalloc, const char *filename, const int linenumber)
+Perl_mem_log_free(Malloc_t oldalloc, const char *filename, const int linenumber, const char *funcname)
{
#ifdef PERL_MEM_LOG_STDERR
/* We can't use PerlIO_printf() for obvious reasons. */
char buf[1024];
- sprintf(buf, "free: %s:%d: %p\n", filename, linenumber, oldalloc);
+ sprintf(buf, "free: %s:%d:%s: %"UVxf"\n",
+ filename, linenumber, funcname, PTR2UV(oldalloc));
write(2, buf, strlen(buf));
#endif
return oldalloc;