mirror of
https://github.com/espressif/openthread.git
synced 2026-08-21 18:09:52 +00:00
[examples] make built-in otPlatCalloc and otPlatFree definitions weak (#8188)
This will allow platforms to define their own `otPlatCalloc` and `otPlatFree` functions which may not map directly to `calloc()` and `free()`
This commit is contained in:
@@ -50,12 +50,12 @@
|
||||
extern void otAppCliInit(otInstance *aInstance);
|
||||
|
||||
#if OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE
|
||||
void *otPlatCAlloc(size_t aNum, size_t aSize)
|
||||
OT_TOOL_WEAK void *otPlatCAlloc(size_t aNum, size_t aSize)
|
||||
{
|
||||
return calloc(aNum, aSize);
|
||||
}
|
||||
|
||||
void otPlatFree(void *aPtr)
|
||||
OT_TOOL_WEAK void otPlatFree(void *aPtr)
|
||||
{
|
||||
free(aPtr);
|
||||
}
|
||||
|
||||
@@ -46,12 +46,12 @@
|
||||
extern void otAppNcpInit(otInstance *aInstance);
|
||||
|
||||
#if OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE
|
||||
void *otPlatCAlloc(size_t aNum, size_t aSize)
|
||||
OT_TOOL_WEAK void *otPlatCAlloc(size_t aNum, size_t aSize)
|
||||
{
|
||||
return calloc(aNum, aSize);
|
||||
}
|
||||
|
||||
void otPlatFree(void *aPtr)
|
||||
OT_TOOL_WEAK void otPlatFree(void *aPtr)
|
||||
{
|
||||
free(aPtr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user