diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-02-07 12:42:29 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-02-07 12:42:29 +0000 |
commit | b08638d7c8e46b3a207705a2e55fdfe4b78cfb3e (patch) | |
tree | f9e60d830d48036b3012822a4eedb909c3c4ce25 /src/chheap.c | |
parent | 37c2720510cf319159d19398533169711d092f6b (diff) | |
download | ChibiOS-b08638d7c8e46b3a207705a2e55fdfe4b78cfb3e.tar.gz ChibiOS-b08638d7c8e46b3a207705a2e55fdfe4b78cfb3e.tar.bz2 ChibiOS-b08638d7c8e46b3a207705a2e55fdfe4b78cfb3e.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@735 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'src/chheap.c')
-rw-r--r-- | src/chheap.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/chheap.c b/src/chheap.c index 46b26f7d8..5193f19b8 100644 --- a/src/chheap.c +++ b/src/chheap.c @@ -26,9 +26,9 @@ #include <ch.h>
-#ifdef CH_USE_HEAP
+#if CH_USE_HEAP
-#ifndef CH_USE_MALLOC_HEAP
+#if !CH_USE_MALLOC_HEAP
#define MAGIC 0xF5A0
#define ALIGN_TYPE void *
@@ -45,11 +45,11 @@ struct header { static struct {
struct header free; /* Guaranteed to be not adjacent to the heap */
-#if defined(CH_USE_MUTEXES)
+#if CH_USE_MUTEXES
#define H_LOCK() chMtxLock(&heap.hmtx)
#define H_UNLOCK() chMtxUnlock()
Mutex hmtx;
-#elif defined(CH_USE_SEMAPHORES)
+#elif CH_USE_SEMAPHORES
#define H_LOCK() chSemWait(&heap.hsem)
#define H_UNLOCK() chSemSignal(&heap.hsem)
Semaphore hsem;
@@ -86,7 +86,7 @@ void heap_init(void) { hp->h_next = NULL;
heap.free.h_next = hp;
heap.free.h_size = 0;
-#if defined(CH_USE_MUTEXES)
+#if CH_USE_MUTEXES
chMtxInit(&heap.hmtx);
#else
chSemInit(&heap.hsem, 1);
@@ -219,11 +219,11 @@ size_t chHeapStatus(size_t *sizep) { #include <stdlib.h>
-#if defined(CH_USE_MUTEXES)
+#if CH_USE_MUTEXES
#define H_LOCK() chMtxLock(&hmtx)
#define H_UNLOCK() chMtxLock(&hmtx)
static Mutex hmtx;
-#elif defined(CH_USE_SEMAPHORES)
+#elif CH_USE_SEMAPHORES
#define H_LOCK() chSemWait(&hsem)
#define H_UNLOCK() chSemSignal(&hsem)
static Semaphore hsem;
@@ -233,7 +233,7 @@ static Semaphore hsem; void heap_init(void) {
-#if defined(CH_USE_MUTEXES)
+#if CH_USE_MUTEXES
chMtxInit(&hmtx);
#else
chSemInit(&hsem, 1);
|