This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

周期性调用HCI_ReadRssiCmd,会导致内存溢出



设置两个变量malloc_cnt[0] 和malloc_cnt【1】,分别在malloc和free里面加,发现malloc里面的变量和free里面的变量差值越来越大,不周期性发HCI_ReadRssiCmd,两个的差值基本不变,不知道为什么?HCI_ReadRssiCmd每5ms调用一次。。。。应为要做BLE定位,所以需要几ms读取一次信号值,请大神们指点一下,谢谢!

void *ICall_malloc(uint_least16_t size)
{
  malloc_cnt[0]++;
  return (ICall_heapMalloc(size));
}

void ICall_free(void *msg)
{
  malloc_cnt[1]++;
  ICall_heapFree(msg);
}