Browse Source

Fix ESP-IDF platform mmap data size error (#3288)

dongheng 1 year ago
parent
commit
e885a072d3
1 changed files with 2 additions and 1 deletions
  1. 2 1
      core/shared/platform/esp-idf/espidf_memmap.c

+ 2 - 1
core/shared/platform/esp-idf/espidf_memmap.c

@@ -55,7 +55,8 @@ os_mmap(void *hint, size_t size, int prot, int flags, os_file_handle file)
 #else
         uint32_t mem_caps = MALLOC_CAP_8BIT;
 #endif
-        void *buf_origin = heap_caps_malloc(size, mem_caps);
+        void *buf_origin =
+            heap_caps_malloc(size + 4 + sizeof(uintptr_t), mem_caps);
         if (!buf_origin) {
             return NULL;
         }