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

This commit is contained in:
dongheng 2024-04-07 20:23:28 +08:00 committed by GitHub
parent 4109fcee57
commit e885a072d3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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