[posix] set external heap callbacks (#6054)

This commit is contained in:
kangping
2021-01-10 08:32:01 -08:00
committed by GitHub
parent 418c9afbe2
commit 12640b17eb
+5
View File
@@ -39,6 +39,7 @@
#include <openthread-core-config.h>
#include <openthread/border_router.h>
#include <openthread/heap.h>
#include <openthread/tasklet.h>
#include <openthread/platform/alarm-milli.h>
#include <openthread/platform/otns.h>
@@ -94,6 +95,10 @@ otInstance *otSysInit(otPlatformConfig *aPlatformConfig)
instance = otInstanceInitSingle();
assert(instance != nullptr);
#if OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE
otHeapSetCAllocFree(calloc, free);
#endif
#if OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE
platformBackboneInit(instance, aPlatformConfig->mBackboneInterfaceName);
#endif