remove unused function declarations and definitions:
- vallocc is #if 0 in source code
- pvalloc is defined but not used
- cfree is defined but not used
- malloc_usable_size is unused
- mallopt is not defined
- mallinfo is not defined
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This patch fix a compiler warning while building sandbox barebox with
gcc version 4.8.2.
common/dlmalloc.c: In function ‘barebox_calloc’:
common/dlmalloc.c:1756:2: warning: ISO C90 forbids mixed declarations
and code [-Wdeclaration-after-statement]
void *mem = malloc(sz);
^
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Memory allocation is very simple in u-boot-v2. So, it makes also sense to
add the "operating system" emulation layer into the main memory management
source file, to keep them at one place and simple.
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Don't try to be smarter than GCC. There are various better optimizations
available than to write our own. So, use the globaly available string
functions instead.
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
When assert() is always defined to do nothing, the debug functions makes no
sense, because they also do nothing. Removing them shrinks the code.
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Use a function prototype style as used in all other u-boot-v2 sources, too.
Also remove C++ support. We do not use C++ in this project.
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
This feature is provided, to support more than u-boot-v2. But its more
confusing than helpful. Remove it and do it straight forward like all other
sources in this tree, too.
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Include the board config first to be able to configure the memory management
in the documented way. If not used, the defaults are used.
On the other hand, there is no need to pollute the other source files with
these local management settings. So, move them from the header into the
C source file.
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
There is no need to init variables with 0. So, move them to the bss and let
the C runtime does this job for us.
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Comment out malloc_trim(). This functions gives back memory to the
system via negative calls to sbrk(). This is completely useless in
U-Boot since noone else could make use of this memory.
- do more POSIX:
- use DIR instead of struct dirent
- use (struct dirent)->d_name instead of (struct dirent)->name
- switch to a new layout for U_BOOT_CMD:
- use C99 initializers to be able to add more fields to the
command struct
- add aliases for commands (needed mainly for help -> ? and test -> [
- This is not done for all commands yet, but the compiler will tell you ;)
- remove trailing white space, trailing empty lines, C++ comments, etc.
- split cmd_boot.c (separate cmd_bdinfo.c and cmd_load.c)
* Patches by Kenneth Johansson, 25 Jun 2003:
- major rework of command structure
(work done mostly by Michal Cendrowski and Joakim Kristiansen)