If I have called
buf = heap_caps_calloc_prefer(8, 2048, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL);
Is it ok to free buf by calling free(buf)?
Or I need to call heap_caps_free() instead?
What's the difference of calling free() v.s. heap_caps_free()?
Is it ok to call free() for memory allocated by heap_caps_calloc_prefer()?
Re: Is it ok to call free() for memory allocated by heap_caps_calloc_prefer()?
Yes. I think free() actually is an alias for heap_caps_free() (as malloc()'ed memory also is allocated using a heap_caps_malloc call)
Who is online
Users browsing this forum: Qwantbot and 5 guests
