yamt commented on a change in pull request #2832:
URL: https://github.com/apache/incubator-nuttx/pull/2832#discussion_r585110911



##########
File path: arch/xtensa/src/esp32/esp32_wifi_adapter.c
##########
@@ -3447,7 +3473,35 @@ static void *esp_malloc_internal(size_t size)
 
 static void *esp_realloc_internal(void *ptr, size_t size)
 {
-  return kmm_realloc(ptr, size);
+#ifdef CONFIG_XTENSA_IMEM_USE_SEPARATE_HEAP
+  return xtensa_imm_realloc(ptr, size);
+#else
+  void *old_ptr = ptr;
+  void *new_ptr = NULL;
+  size_t old_size = 0;
+  if (size == 0 || esp32_ptr_extram(old_ptr))

Review comment:
       for `size == 0` case, you should free `ptr`.
   
   i don't think you need to check esp32_ptr_extram(old_ptr). the old_ptr will 
be freed on successful realloc anyway.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to