- 論壇徽章:
- 0
|
#include <stdio.h>
#include <pthread.h>
void *func(void *)
{
return NULL;
}
int main(int argc, char* argv[])
{
pthread_t id;
pthread_create(&id, NULL, func, NULL);
pthread_join(id, NULL);
return 0;
}
這個(gè)最簡(jiǎn)單的程序跑valgrind卻有警告,如下:
==2296== 272 bytes in 1 blocks are possibly lost in loss record 1 of 1
==2296== at 0x4906B0C: calloc (vg_replace_malloc.c:467)
==2296== by 0x302AD0D212: _dl_allocate_tls (in /lib64/ld-2.3.4.so)
==2296== by 0x302B806706: pthread_create@@GLIBC_2.2.5 (in /lib64/tls/libpthread-2.3.4.so)
==2296== by 0x40061E: main (in /home/users/lichuang/myCode/SimQThread/a.out)
請(qǐng)問有辦法把這個(gè)警告弄掉嗎? |
|