diff options
author | Tom Rini <trini@ti.com> | 2014-11-24 12:01:48 -0500 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2014-11-24 12:01:48 -0500 |
commit | 1739564e753bc3a8097f8937a3cbe738bdaaed5d (patch) | |
tree | 56fe759e62f129dc055b6f6a22f299f6c8b5cdde /include/malloc.h | |
parent | 746667f1e56bf08d03e66a178df3c4f4f6c806e1 (diff) | |
parent | 17b28edb37a33d0c89089faf36e4edd7084f65fa (diff) | |
download | u-boot-imx-1739564e753bc3a8097f8937a3cbe738bdaaed5d.zip u-boot-imx-1739564e753bc3a8097f8937a3cbe738bdaaed5d.tar.gz u-boot-imx-1739564e753bc3a8097f8937a3cbe738bdaaed5d.tar.bz2 |
Merge git://git.denx.de/u-boot-dm
Conflicts:
drivers/serial/serial-uclass.c
Signed-off-by: Tom Rini <trini@ti.com>
Diffstat (limited to 'include/malloc.h')
-rw-r--r-- | include/malloc.h | 60 |
1 files changed, 37 insertions, 23 deletions
diff --git a/include/malloc.h b/include/malloc.h index c33f3b4..5df6348 100644 --- a/include/malloc.h +++ b/include/malloc.h @@ -872,33 +872,46 @@ extern Void_t* sbrk(); #else -#ifdef USE_DL_PREFIX -#define cALLOc dlcalloc -#define fREe dlfree -#define mALLOc dlmalloc -#define mEMALIGn dlmemalign -#define rEALLOc dlrealloc -#define vALLOc dlvalloc -#define pvALLOc dlpvalloc -#define mALLINFo dlmallinfo -#define mALLOPt dlmallopt -#else /* USE_DL_PREFIX */ -#define cALLOc calloc -#define fREe free -#define mALLOc malloc -#define mEMALIGn memalign -#define rEALLOc realloc -#define vALLOc valloc -#define pvALLOc pvalloc -#define mALLINFo mallinfo -#define mALLOPt mallopt -#endif /* USE_DL_PREFIX */ +#ifdef CONFIG_SYS_MALLOC_SIMPLE +#define malloc malloc_simple +#define realloc realloc_simple +#define memalign memalign_simple +static inline void free(void *ptr) {} +void *calloc(size_t nmemb, size_t size); +void *memalign_simple(size_t alignment, size_t bytes); +void *realloc_simple(void *ptr, size_t size); +#else + +# ifdef USE_DL_PREFIX +# define cALLOc dlcalloc +# define fREe dlfree +# define mALLOc dlmalloc +# define mEMALIGn dlmemalign +# define rEALLOc dlrealloc +# define vALLOc dlvalloc +# define pvALLOc dlpvalloc +# define mALLINFo dlmallinfo +# define mALLOPt dlmallopt +# else /* USE_DL_PREFIX */ +# define cALLOc calloc +# define fREe free +# define mALLOc malloc +# define mEMALIGn memalign +# define rEALLOc realloc +# define vALLOc valloc +# define pvALLOc pvalloc +# define mALLINFo mallinfo +# define mALLOPt mallopt +# endif /* USE_DL_PREFIX */ #endif /* Public routines */ -#if __STD_C +/* Simple versions which can be used when space is tight */ +void *malloc_simple(size_t size); + +# if __STD_C Void_t* mALLOc(size_t); void fREe(Void_t*); @@ -913,7 +926,7 @@ size_t malloc_usable_size(Void_t*); void malloc_stats(void); int mALLOPt(int, int); struct mallinfo mALLINFo(void); -#else +# else Void_t* mALLOc(); void fREe(); Void_t* rEALLOc(); @@ -927,6 +940,7 @@ size_t malloc_usable_size(); void malloc_stats(); int mALLOPt(); struct mallinfo mALLINFo(); +# endif #endif /* |