From 12640b17eb75c2b7cb2a327fd71619d3d17cb008 Mon Sep 17 00:00:00 2001 From: kangping Date: Mon, 11 Jan 2021 00:32:01 +0800 Subject: [PATCH] [posix] set external heap callbacks (#6054) --- src/posix/platform/system.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/posix/platform/system.cpp b/src/posix/platform/system.cpp index ede5fdfb2..9e0018771 100644 --- a/src/posix/platform/system.cpp +++ b/src/posix/platform/system.cpp @@ -39,6 +39,7 @@ #include #include +#include #include #include #include @@ -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