Skip to content

Commit

Permalink
fix(api): Fix os_calloc declaration
Browse files Browse the repository at this point in the history
Fix the definition error of os_calloc

internal gitlab: 59208741
  • Loading branch information
wujiangang committed Dec 5, 2017
1 parent 493e8c0 commit fe32f7f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions include/mem.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ void *pvPortZalloc (size_t sz, const char *, unsigned);
void *pvPortRealloc (void *p, size_t n, const char *, unsigned);

#ifndef MEMLEAK_DEBUG
#define MEMLEAK_DEBUG_ENABLE 0
#define MEMLEAK_DEBUG_ENABLE 0
#define os_free(s) vPortFree(s, "", 0)
#define os_malloc(s) pvPortMalloc(s, "", 0)
#define os_calloc(s) pvPortCalloc(s, "", 0);
#define os_calloc(l, s) pvPortCalloc(l, s, "", 0);
#define os_realloc(p, s) pvPortRealloc(p, s, "", 0)
#define os_zalloc(s) pvPortZalloc(s, "", 0)
#else
Expand All @@ -64,10 +64,10 @@ do{\
pvPortMalloc(s, mem_debug_file, __LINE__); \
})

#define os_calloc(s) \
#define os_calloc(l, s) \
({ \
static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; \
pvPortCalloc(s, mem_debug_file, __LINE__); \
pvPortCalloc(l, s, mem_debug_file, __LINE__); \
})

#define os_realloc(p, s) \
Expand Down
2 changes: 1 addition & 1 deletion third_party/include/lwip/mem.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ do{\
#define mem_malloc(s) ({const char *file = mem_debug_file; pvPortMalloc(s, file, __LINE__);})
#endif
#ifndef mem_calloc
#define mem_calloc(s) ({const char *file = mem_debug_file; pvPortCalloc(s, file, __LINE__);})
#define mem_calloc(l, s) ({const char *file = mem_debug_file; pvPortCalloc(l, s, file, __LINE__);})
#endif
#ifndef mem_realloc
#define mem_realloc(p, s) ({const char *file = mem_debug_file; pvPortRealloc(p, s, file, __LINE__);})
Expand Down

0 comments on commit fe32f7f

Please sign in to comment.