4.61 beta

This commit is contained in:
Igor Pavlov
2008-11-23 00:00:00 +00:00
committed by Kornel Lesiński
parent c10e6b16f6
commit b717a4dbfe
80 changed files with 1605 additions and 1312 deletions

View File

@@ -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);
}