Fix ESP-IDF platform mmap data size error.

This commit is contained in:
Dong Heng 2024-04-07 19:43:29 +08:00
parent 4109fcee57
commit 432cf4b9e7

View File

@ -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;
}