9
0
Fork 0

tlsf: enable assertions

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2011-12-23 00:54:28 +01:00
parent b25bb1f072
commit 2467c61b3b
1 changed files with 7 additions and 10 deletions

View File

@ -1,20 +1,17 @@
#ifndef __BAREBOX__
#include <assert.h>
#include <limits.h>
#endif
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <linux/stringify.h>
#include "tlsf.h"
#include "tlsfbits.h"
#ifdef __BAREBOX__
#ifndef _DEBUG
#define _DEBUG 0
#endif
#define tlsf_assert(expr) ((void) (0))
#ifdef DEBUG
#define tlsf_assert(expr) \
((expr) ? (void)(0) : printf("%s\n", __stringify(expr)))
#else
#define tlsf_assert(expr) (void)(0)
#endif
/*
@ -759,7 +756,7 @@ tlsf_pool tlsf_create(void* mem, size_t bytes)
const size_t pool_bytes = align_down(bytes - pool_overhead, ALIGN_SIZE);
pool_t* pool = tlsf_cast(pool_t*, mem);
#if _DEBUG
#ifdef DEBUG
/* Verify ffs/fls work properly. */
int rv = 0;
rv += (tlsf_ffs(0) == -1) ? 0 : 0x1;