gpt4 book ai didi

c++ - timer_create 给出内存泄漏问题 "Syscall param timer_create(evp) points to uninitialised byte(s)"

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:39:46 26 4
gpt4 key购买 nike

    struct sigevent timerEvent;
memset(&timerEvent, 0, sizeof(timerEvent));

timerEvent.sigev_value.sival_int = 0;
timerEvent.sigev_value.sival_ptr = diaBase;
timerEvent.sigev_notify = SIGEV_THREAD;
timerEvent._sigev_un._sigev_thread._function = function;
timerEvent._sigev_un._sigev_thread._attribute = NULL;

timer_t timer_ID;

int retVal;
if((retVal = timer_create (CLOCK_REALTIME, &timerEvent, &timer_ID )) != -1)
{
printf("Timer Created Successfully: %ld\n", timer_ID );
}
else
{
printf("Error Creating Timer\n");
}

Memory Leak,以下表示

Syscall param timer_create(evp) points to uninitialised byte(s)
==27384== at 0x530595: timer_create (in /lib/librt-2.5.so)

最佳答案

关于c++ - timer_create 给出内存泄漏问题 "Syscall param timer_create(evp) points to uninitialised byte(s)",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6122594/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com