From d684c21619905153eff68c43927207248925f6c2 Mon Sep 17 00:00:00 2001 From: Leo C Date: Tue, 12 Aug 2014 12:35:28 +0200 Subject: New U-Boot like AVR main program. Uses U-Boot source code taken from: git://git.denx.de/u-boot.git --- avr/xmalloc.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 avr/xmalloc.c (limited to 'avr/xmalloc.c') diff --git a/avr/xmalloc.c b/avr/xmalloc.c new file mode 100644 index 0000000..9bf2684 --- /dev/null +++ b/avr/xmalloc.c @@ -0,0 +1,27 @@ +#include + +#include "debug.h" +#include "xmalloc.h" + +void* xmalloc(size_t size) +{ + void *p; + + p = malloc(size); + + if (p == NULL) + debug("*** Out of memory!\n"); + + return p; +} + + +void* xrealloc(void *p, size_t size) +{ + p = realloc(p, size); + + if (p == NULL) + debug("*** Out of memory!\n"); + + return p; +} -- cgit v1.2.3