feat(openthread): support openthread heap allocation from PSRAM

This commit is contained in:
zwx
2026-01-14 14:18:20 +08:00
parent 99e8257a31
commit 31c1f34053
2 changed files with 15 additions and 4 deletions
@@ -1,10 +1,11 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "esp_openthread.h"
#include "esp_openthread_platform.h"
#include "openthread/platform/memory.h"
@@ -12,10 +13,10 @@
void *otPlatCAlloc(size_t num, size_t size)
{
return calloc(num, size);
return heap_caps_calloc(num, size, esp_openthread_get_alloc_caps());
}
void otPlatFree(void *ptr)
{
free(ptr);
heap_caps_free(ptr);
}