diff options
Diffstat (limited to 'os/kernel/src/chheap.c')
-rw-r--r-- | os/kernel/src/chheap.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/os/kernel/src/chheap.c b/os/kernel/src/chheap.c index 13db7cf6b..b90b21909 100644 --- a/os/kernel/src/chheap.c +++ b/os/kernel/src/chheap.c @@ -1,5 +1,6 @@ /*
- ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010 Giovanni Di Sirio.
+ ChibiOS/RT - Copyright (C) 2006,2007,2008,2009,2010,
+ 2011 Giovanni Di Sirio.
This file is part of ChibiOS/RT.
@@ -64,7 +65,7 @@ static MemoryHeap default_heap; *
* @notapi
*/
-void heap_init(void) {
+void _heap_init(void) {
default_heap.h_provider = chCoreAlloc;
default_heap.h_free.h.u.next = (union heap_header *)NULL;
default_heap.h_free.h.size = 0;
@@ -79,6 +80,8 @@ void heap_init(void) { * @brief Initializes a memory heap from a static memory area.
* @pre Both the heap buffer base and the heap size must be aligned to
* the @p stkalign_t type size.
+ * @pre In order to use this function the option @p CH_USE_MALLOC_HEAP
+ * must be disabled.
*
* @param[out] heapp pointer to the memory heap descriptor to be initialized
* @param[in] buf heap buffer base
@@ -125,7 +128,7 @@ void *chHeapAlloc(MemoryHeap *heapp, size_t size) { if (heapp == NULL)
heapp = &default_heap;
- size = MEM_ALIGN_SIZE(size);
+ size = MEM_ALIGN_NEXT(size);
qp = &heapp->h_free;
H_LOCK(heapp);
@@ -270,7 +273,7 @@ static Mutex hmtx; static Semaphore hsem;
#endif
-void heap_init(void) {
+void _heap_init(void) {
#if CH_USE_MUTEXES
chMtxInit(&hmtx);
|