diff options
Diffstat (limited to 'os')
-rw-r--r-- | os/kernel/include/chheap.h | 2 | ||||
-rw-r--r-- | os/kernel/src/chheap.c | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/os/kernel/include/chheap.h b/os/kernel/include/chheap.h index eb642cd18..0db1cbc1d 100644 --- a/os/kernel/include/chheap.h +++ b/os/kernel/include/chheap.h @@ -76,7 +76,9 @@ struct memory_heap { extern "C" {
#endif
void _heap_init(void);
+#if !CH_USE_MALLOC_HEAP
void chHeapInit(MemoryHeap *heapp, void *buf, size_t size);
+#endif
void *chHeapAlloc(MemoryHeap *heapp, size_t size);
void chHeapFree(void *p);
size_t chHeapStatus(MemoryHeap *heapp, size_t *sizep);
diff --git a/os/kernel/src/chheap.c b/os/kernel/src/chheap.c index bcfca9b77..b90b21909 100644 --- a/os/kernel/src/chheap.c +++ b/os/kernel/src/chheap.c @@ -80,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
@@ -271,7 +273,7 @@ static Mutex hmtx; static Semaphore hsem;
#endif
-void heap_init(void) {
+void _heap_init(void) {
#if CH_USE_MUTEXES
chMtxInit(&hmtx);
|