mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-04 05:39:53 +00:00
Added mem_calloc().
This commit is contained in:
parent
0b4402ebc8
commit
95cbf95c50
@ -500,4 +500,15 @@ mem_malloc(mem_size_t size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif /* MEM_USE_POOLS */
|
#endif /* MEM_USE_POOLS */
|
||||||
|
|
||||||
|
void *mem_calloc(size_t count, size_t size)
|
||||||
|
{
|
||||||
|
void *p;
|
||||||
|
|
||||||
|
p = mem_malloc(count * size);
|
||||||
|
if(p) {
|
||||||
|
memset(p, 0, count * size);
|
||||||
|
}
|
||||||
|
return p;
|
||||||
|
}
|
||||||
#endif /* !MEM_LIBC_MALLOC */
|
#endif /* !MEM_LIBC_MALLOC */
|
||||||
|
@ -62,6 +62,9 @@ typedef u16_t mem_size_t;
|
|||||||
#ifndef mem_malloc
|
#ifndef mem_malloc
|
||||||
#define mem_malloc(x) malloc(x)
|
#define mem_malloc(x) malloc(x)
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef mem_calloc
|
||||||
|
#define mem_calloc(x, y) calloc(x, y)
|
||||||
|
#endif
|
||||||
#ifndef mem_realloc
|
#ifndef mem_realloc
|
||||||
#define mem_realloc(x, size) realloc(x,size)
|
#define mem_realloc(x, size) realloc(x,size)
|
||||||
#endif
|
#endif
|
||||||
@ -81,6 +84,7 @@ void *mem_realloc(void *mem, mem_size_t size);
|
|||||||
#endif /* MEM_USE_POOLS */
|
#endif /* MEM_USE_POOLS */
|
||||||
void *mem_malloc(mem_size_t size);
|
void *mem_malloc(mem_size_t size);
|
||||||
void mem_free(void *mem);
|
void mem_free(void *mem);
|
||||||
|
void *mem_calloc(size_t count, size_t size);
|
||||||
#endif /* MEM_LIBC_MALLOC */
|
#endif /* MEM_LIBC_MALLOC */
|
||||||
|
|
||||||
#ifndef LWIP_MEM_ALIGN_SIZE
|
#ifndef LWIP_MEM_ALIGN_SIZE
|
||||||
|
Loading…
Reference in New Issue
Block a user