mirror of
https://github.com/espressif/openthread.git
synced 2026-10-02 05:47:40 +00:00
[posix] set up heap before creating OT instance (#6128)
This is a quick fix that allows heap usage in constructors.
This commit is contained in:
@@ -92,13 +92,13 @@ otInstance *otSysInit(otPlatformConfig *aPlatformConfig)
|
|||||||
#endif
|
#endif
|
||||||
platformRandomInit();
|
platformRandomInit();
|
||||||
|
|
||||||
instance = otInstanceInitSingle();
|
|
||||||
assert(instance != nullptr);
|
|
||||||
|
|
||||||
#if OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE
|
#if OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE
|
||||||
otHeapSetCAllocFree(calloc, free);
|
otHeapSetCAllocFree(calloc, free);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
instance = otInstanceInitSingle();
|
||||||
|
assert(instance != nullptr);
|
||||||
|
|
||||||
#if OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE
|
#if OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE
|
||||||
platformBackboneInit(instance, aPlatformConfig->mBackboneInterfaceName);
|
platformBackboneInit(instance, aPlatformConfig->mBackboneInterfaceName);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user