mirror of
https://github.com/espressif/esp-idf.git
synced 2025-10-04 11:00:58 +02:00
heap: add a unit test for malloc(0) and slightly optimize heap_caps_malloc_prefer
This commit is contained in:
@@ -267,7 +267,7 @@ IRAM_ATTR void *heap_caps_malloc_prefer( size_t size, size_t num, ... )
|
||||
while (num--) {
|
||||
caps = va_arg( argp, uint32_t );
|
||||
r = heap_caps_malloc_base( size, caps );
|
||||
if (r != NULL) {
|
||||
if (r != NULL || size == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user