Просмотр исходного кода

add:luat_heap_realloc使用OS_Realloc

Dozingfiretruck 4 лет назад
Родитель
Сommit
77344e4bbb
1 измененных файлов с 1 добавлено и 5 удалено
  1. 1 5
      application/src/luat_malloc_air105.c

+ 1 - 5
application/src/luat_malloc_air105.c

@@ -49,11 +49,7 @@ void luat_heap_free(void* ptr) {
 }
 
 void* luat_heap_realloc(void* ptr, size_t len) {
-    void* tmp = luat_heap_malloc(len);
-    if (tmp && ptr) {
-        memcpy(tmp, ptr, len);
-    }
-    return tmp;
+    return OS_Realloc(ptr,len);
 }
 
 void* luat_heap_calloc(size_t count, size_t _size) {