mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge branch '10.4' into 10.5
This commit is contained in:
@@ -66,7 +66,7 @@ struct st_irem
|
||||
uint32 marker; /* Underrun marker value */
|
||||
};
|
||||
|
||||
static int sf_malloc_count= 0; /* Number of allocated chunks */
|
||||
static uint sf_malloc_count= 0; /* Number of allocated chunks */
|
||||
|
||||
static void *sf_min_adress= (void*) (intptr)~0ULL,
|
||||
*sf_max_adress= 0;
|
||||
@@ -345,7 +345,7 @@ int sf_sanity()
|
||||
{
|
||||
struct st_irem *irem;
|
||||
int flag= 0;
|
||||
int count= 0;
|
||||
uint count= 0;
|
||||
|
||||
pthread_mutex_lock(&sf_mutex);
|
||||
count= sf_malloc_count;
|
||||
@@ -370,6 +370,7 @@ void sf_report_leaked_memory(my_thread_id id)
|
||||
{
|
||||
size_t total= 0;
|
||||
struct st_irem *irem;
|
||||
uint first= 0, chunks= 0;
|
||||
|
||||
sf_sanity();
|
||||
|
||||
@@ -381,15 +382,18 @@ void sf_report_leaked_memory(my_thread_id id)
|
||||
{
|
||||
my_thread_id tid = irem->thread_id && irem->flags & MY_THREAD_SPECIFIC ?
|
||||
irem->thread_id : 0;
|
||||
if (!first++)
|
||||
fprintf(stderr, "Memory report from safemalloc\n");
|
||||
fprintf(stderr, "Warning: %4lu bytes lost at %p, allocated by T@%llu at ",
|
||||
(ulong) irem->datasize, (char*) (irem + 1), tid);
|
||||
print_stack(irem->frame);
|
||||
total+= irem->datasize;
|
||||
chunks++;
|
||||
}
|
||||
}
|
||||
if (total)
|
||||
fprintf(stderr, "Memory lost: %lu bytes in %d chunks\n",
|
||||
(ulong) total, sf_malloc_count);
|
||||
fprintf(stderr, "Memory lost: %lu bytes in %u chunks of %u total chunks\n",
|
||||
(ulong) total, chunks, sf_malloc_count);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user