summaryrefslogtreecommitdiff
path: root/common/dlmalloc.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2011-06-16 13:11:41 -0700
committerSimon Glass <sjg@chromium.org>2011-08-29 10:39:31 -0700
commitfea2a094904aa9fd76ae423339927dcd2e058049 (patch)
treed99fb80e4567509f238fe67d66694f03be58ca42 /common/dlmalloc.c
parent84d9e903f1b6d9c48e3615fd4bb5b2eee3ff79a4 (diff)
Add assert() for debug assertions
assert() is like BUG_ON() but compiles to nothing unless DEBUG is defined. This is useful when a condition is an error but a board reset is unlikely to fix it, so it is better to soldier on in hope. Assertion failures should be caught during development/test. It turns out that assert() is defined separately in a few places in U-Boot with various meanings. Build errors exposed by this change (and defining DEBUG) are also fixed in this commit. BUG=chromium-os:11623 TEST=build U-Boot for seaboard Change-Id: I27500491d2328405694bfd65ab991d42d9641927 Reviewed-on: http://gerrit.chromium.org/gerrit/2777 Tested-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anton Staaf <robotboy@chromium.org>
Diffstat (limited to 'common/dlmalloc.c')
-rw-r--r--common/dlmalloc.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/common/dlmalloc.c b/common/dlmalloc.c
index e9bab09b8ea..f2080c64bae 100644
--- a/common/dlmalloc.c
+++ b/common/dlmalloc.c
@@ -286,13 +286,6 @@ extern "C" {
*/
-#ifdef DEBUG
-#include <assert.h>
-#else
-#define assert(x) ((void)0)
-#endif
-
-
/*
INTERNAL_SIZE_T is the word-size used for internal bookkeeping
of chunk sizes. On a 64-bit machine, you can reduce malloc