From 0a0c74ae1b31ad02f703b3645340d3aea31afec7 Mon Sep 17 00:00:00 2001 From: Jakob Hasse Date: Mon, 11 Mar 2024 11:33:24 +0800 Subject: [PATCH] docs(heap): Fixed mistake in the heap allocator docs Closes https://github.com/espressif/esp-idf/issues/13353 --- docs/en/api-guides/external-ram.rst | 4 ++-- docs/zh_CN/api-guides/external-ram.rst | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/en/api-guides/external-ram.rst b/docs/en/api-guides/external-ram.rst index 82b1dc417d..0d2d1dce22 100644 --- a/docs/en/api-guides/external-ram.rst +++ b/docs/en/api-guides/external-ram.rst @@ -91,8 +91,8 @@ This allows any application to use the external RAM without having to rewrite th An additional configuration item, :ref:`CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL`, can be used to set the size threshold when a single allocation should prefer external memory: -- When allocating a size less than the threshold, the allocator will try internal memory first. -- When allocating a size equal to or larger than the threshold, the allocator will try external memory first. +- When allocating a size less than or equal to the threshold, the allocator will try internal memory first. +- When allocating a size larger than the threshold, the allocator will try external memory first. If a suitable block of preferred internal/external memory is not available, the allocator will try the other type of memory. diff --git a/docs/zh_CN/api-guides/external-ram.rst b/docs/zh_CN/api-guides/external-ram.rst index 27e5440a12..4b8fcb720d 100644 --- a/docs/zh_CN/api-guides/external-ram.rst +++ b/docs/zh_CN/api-guides/external-ram.rst @@ -88,8 +88,8 @@ ESP-IDF 启动过程中,片外 RAM 被映射到以 {IDF_TARGET_PSRAM_ADDR_STAR 如果某次内存分配偏向于片外存储器,您也可以使用 :ref:`CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL` 设置分配空间的大小阈值,控制分配结果: -- 如果分配的空间小于阈值,分配程序将首先选择内部存储器。 -- 如果分配的空间等于或大于阈值,分配程序将首先选择外部存储器。 +- 如果分配的空间小于或等于阈值,分配程序将首先选择内部存储器。 +- 如果分配的空间大于阈值,分配程序将首先选择外部存储器。 如果优先考虑的内部或外部存储器中没有可用的存储块,分配程序则会选择其他类型存储。