|
1 | 1 | #include <stdint.h> |
2 | 2 | #include <stddef.h> |
3 | 3 | #include <stdio.h> |
| 4 | +#include <stdlib.h> |
4 | 5 | #include "espnet.h" |
5 | 6 | #include "freertos/FreeRTOS.h" |
6 | 7 | #include "freertos/semphr.h" |
@@ -163,13 +164,6 @@ static int32_t _task_get_max_priority() { |
163 | 164 | P(_task_get_max_priority) |
164 | 165 | return 0; |
165 | 166 | } |
166 | | -static void* _malloc(unsigned int size) { |
167 | | - P(_malloc) |
168 | | - return NULL; |
169 | | -} |
170 | | -static void _free(void *p) { |
171 | | - P(_free) |
172 | | -} |
173 | 167 | static int32_t _event_post(const char* event_base, int32_t event_id, void* event_data, size_t event_data_size, uint32_t ticks_to_wait) { |
174 | 168 | P(_event_post) |
175 | 169 | return 0; |
@@ -335,20 +329,17 @@ static void* _zalloc_internal(size_t size) { |
335 | 329 | return NULL; |
336 | 330 | } |
337 | 331 | static void* _wifi_malloc(size_t size) { |
338 | | - P(_wifi_malloc) |
339 | | - return NULL; |
| 332 | + return malloc(size); |
340 | 333 | } |
341 | 334 | static void* _wifi_realloc(void *ptr, size_t size) { |
342 | 335 | P(_wifi_realloc) |
343 | 336 | return NULL; |
344 | 337 | } |
345 | 338 | static void* _wifi_calloc(size_t n, size_t size) { |
346 | | - P(_wifi_calloc) |
347 | | - return NULL; |
| 339 | + return calloc(n, size); |
348 | 340 | } |
349 | 341 | static void* _wifi_zalloc(size_t size) { |
350 | | - P(_wifi_zalloc) |
351 | | - return NULL; |
| 342 | + return calloc(1, size); |
352 | 343 | } |
353 | 344 | static void* _wifi_create_queue(int queue_len, int item_size) { |
354 | 345 | P(_wifi_create_queue) |
@@ -475,8 +466,8 @@ wifi_osi_funcs_t g_wifi_osi_funcs = { |
475 | 466 | ._task_ms_to_tick = _task_ms_to_tick, |
476 | 467 | ._task_get_current_task = _task_get_current_task, |
477 | 468 | ._task_get_max_priority = _task_get_max_priority, |
478 | | - ._malloc = _malloc, |
479 | | - ._free = _free, |
| 469 | + ._malloc = malloc, |
| 470 | + ._free = free, |
480 | 471 | ._event_post = _event_post, |
481 | 472 | ._get_free_heap_size = _get_free_heap_size, |
482 | 473 | ._rand = _rand, |
|
0 commit comments