From: Antony Pavlov <antonynpavlov@gmail.com>
To: barebox@lists.infradead.org
Subject: [RFC PATCH 2/3] adapt tlsf for barebox
Date: Thu, 8 Dec 2011 18:03:48 +0400 [thread overview]
Message-ID: <1323353029-17281-3-git-send-email-antonynpavlov@gmail.com> (raw)
In-Reply-To: <1323353029-17281-1-git-send-email-antonynpavlov@gmail.com>
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
common/tlsf.c | 11 +++++++++++
include/tlsf.h | 2 +-
2 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/common/tlsf.c b/common/tlsf.c
index 02dc8d4..b3de976 100644
--- a/common/tlsf.c
+++ b/common/tlsf.c
@@ -1,5 +1,7 @@
+#ifndef __BAREBOX__
#include <assert.h>
#include <limits.h>
+#endif
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
@@ -8,6 +10,13 @@
#include "tlsf.h"
#include "tlsfbits.h"
+#ifdef __BAREBOX__
+#ifndef _DEBUG
+#define _DEBUG 0
+#endif
+#define tlsf_assert(expr) ((void) (0))
+#endif
+
/*
** Constants.
*/
@@ -82,6 +91,7 @@ enum tlsf_private
#define tlsf_static_assert(exp) \
typedef char _tlsf_glue(static_assert, __LINE__) [(exp) ? 1 : -1]
+#ifndef __BAREBOX__
/* This code has been tested on 32- and 64-bit (LP/LLP) architectures. */
tlsf_static_assert(sizeof(int) * CHAR_BIT == 32);
tlsf_static_assert(sizeof(size_t) * CHAR_BIT >= 32);
@@ -92,6 +102,7 @@ tlsf_static_assert(sizeof(unsigned int) * CHAR_BIT >= SL_INDEX_COUNT);
/* Ensure we've properly tuned our sizes. */
tlsf_static_assert(ALIGN_SIZE == SMALL_BLOCK_SIZE / SL_INDEX_COUNT);
+#endif
/*
** Data structures and associated constants.
diff --git a/include/tlsf.h b/include/tlsf.h
index de7f90b..d575e16 100644
--- a/include/tlsf.h
+++ b/include/tlsf.h
@@ -43,7 +43,7 @@ int tlsf_check_heap(tlsf_pool pool);
size_t tlsf_block_size(void* ptr);
/* Overhead of per-pool internal structures. */
-size_t tlsf_overhead();
+size_t tlsf_overhead(void);
#if defined(__cplusplus)
};
--
1.7.7.3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2011-12-08 14:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-08 14:03 [RFC PATCH 0/3] add tlsf memory allocator Antony Pavlov
2011-12-08 14:03 ` [RFC PATCH 1/3] import TLSF 2.0 from http://tlsf.baisoku.org/tlsf-2.0.zip Antony Pavlov
2011-12-09 9:24 ` Sascha Hauer
2011-12-08 14:03 ` Antony Pavlov [this message]
2011-12-08 14:03 ` [RFC PATCH 3/3] add tlsf-based malloc implementation Antony Pavlov
2011-12-09 9:31 ` Sascha Hauer
2011-12-09 9:17 ` [RFC PATCH 0/3] add tlsf memory allocator Sascha Hauer
2011-12-23 10:04 ` Sascha Hauer
2011-12-23 11:20 ` Antony Pavlov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1323353029-17281-3-git-send-email-antonynpavlov@gmail.com \
--to=antonynpavlov@gmail.com \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox