RTOS SDK 内存分配API问题

mengzawj
Posts: 24
Joined: Mon Feb 01, 2016 12:06 am

RTOS SDK 内存分配API问题

Postby mengzawj » Fri Jan 06, 2017 3:21 pm

为什么1.5版本 RTOS SDK内存分配函数改成了带文件名和行号的非标准版本?不能兼容以前的程序了

Code: Select all

/*
 * Map to the memory management routines required for the port.
 */
/* for freeRTOS, MEMLEAK_DEBUG must be enabled. */
#if 0
void *pvPortMalloc( size_t xSize ) PRIVILEGED_FUNCTION;
void vPortFree( void *pv ) PRIVILEGED_FUNCTION;
#else
void *pvPortMalloc( size_t xSize, const char *file, unsigned line) PRIVILEGED_FUNCTION;
void vPortFree( void *pv, const char * file, unsigned line) PRIVILEGED_FUNCTION;
#endif

ESP_Xutao
Posts: 134
Joined: Tue Sep 27, 2016 5:42 pm

Re: RTOS SDK 内存分配API问题

Postby ESP_Xutao » Tue Jan 10, 2017 10:56 am

你好;
这个是可以兼容的,修改一下就可以了。
heap_4.c

Code: Select all

#ifndef MEMLEAK_DEBUG
void *pvPortMalloc( size_t xWantedSize )
#else
void *pvPortMalloc( size_t xWantedSize, const char * file, unsigned line)
#endif

Who is online

Users browsing this forum: MikaelRal and 2 guests