mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-04 23:29:25 +00:00
If MEM_LIBC_MALLOC==1, allow the defines (e.g. mem_malloc() -> malloc()) to be overriden in case the C-library malloc implementation is not protected against concurrent access.
This commit is contained in:
parent
4dbf1dcad4
commit
1571881f7a
@ -23,6 +23,11 @@ HISTORY
|
||||
|
||||
++ New features:
|
||||
|
||||
2007-05-08 Simon Goldschmidt
|
||||
* mem.h: If MEM_LIBC_MALLOC==1, allow the defines (e.g. mem_malloc() -> malloc())
|
||||
to be overriden in case the C-library malloc implementation is not protected
|
||||
against concurrent access.
|
||||
|
||||
2007-05-04 Simon Goldschmidt (Atte Kojo)
|
||||
* etharp.c: Introduced fast one-entry-cache to speed up ARP lookup when sending
|
||||
multiple packets to the same host.
|
||||
|
@ -46,16 +46,25 @@ typedef u16_t mem_size_t;
|
||||
#if MEM_LIBC_MALLOC
|
||||
/* aliases for C library malloc() */
|
||||
#define mem_init()
|
||||
/* in case C library malloc() needs extra protection,
|
||||
* allow these defines to be overridden.
|
||||
*/
|
||||
#ifndef mem_free
|
||||
#define mem_free(x) free(x)
|
||||
#endif
|
||||
#ifndef mem_malloc
|
||||
#define mem_malloc(x) malloc(x)
|
||||
#endif
|
||||
#ifndef mem_realloc
|
||||
#define mem_realloc(x, size) realloc(x,size)
|
||||
#else
|
||||
#endif
|
||||
#else /* MEM_LIBC_MALLOC */
|
||||
/* lwIP alternative malloc */
|
||||
void mem_init(void);
|
||||
void *mem_malloc(mem_size_t size);
|
||||
void mem_free(void *mem);
|
||||
void *mem_realloc(void *mem, mem_size_t size);
|
||||
#endif
|
||||
#endif /* MEM_LIBC_MALLOC */
|
||||
|
||||
#ifndef MEM_ALIGN_SIZE
|
||||
#define MEM_ALIGN_SIZE(size) (((size) + MEM_ALIGNMENT - 1) & ~(MEM_ALIGNMENT-1))
|
||||
|
Loading…
Reference in New Issue
Block a user