Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/C/Alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'C/Alloc.c')
-rwxr-xr-xC/Alloc.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/C/Alloc.c b/C/Alloc.c
index 63b7da0c..358a7b52 100755
--- a/C/Alloc.c
+++ b/C/Alloc.c
@@ -1,5 +1,5 @@
/* Alloc.c -- Memory allocation functions
-2008-08-05
+2008-09-24
Igor Pavlov
Public domain */
@@ -25,16 +25,21 @@ void *MyAlloc(size_t size)
if (size == 0)
return 0;
#ifdef _SZ_ALLOC_DEBUG
- fprintf(stderr, "\nAlloc %10d bytes; count = %10d", size, g_allocCount++);
- #endif
+ {
+ void *p = malloc(size);
+ fprintf(stderr, "\nAlloc %10d bytes, count = %10d, addr = %8X", size, g_allocCount++, (unsigned)p);
+ return p;
+ }
+ #else
return malloc(size);
+ #endif
}
void MyFree(void *address)
{
#ifdef _SZ_ALLOC_DEBUG
if (address != 0)
- fprintf(stderr, "\nFree; count = %10d", --g_allocCount);
+ fprintf(stderr, "\nFree; count = %10d, addr = %8X", --g_allocCount, (unsigned)address);
#endif
free(address);
}