diff options
| author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-10-20 17:26:27 +0000 |
|---|---|---|
| committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-10-20 17:26:27 +0000 |
| commit | 7d689a5fae4f0950c8cb8e291744465ea5d2ca93 (patch) | |
| tree | d9b262059d69cbe25cdcf1c9aa4f0e6f2f342337 /os/kernel/src | |
| parent | 2c41c0d442aa3cea412fba318d4fe0a7cfd276d6 (diff) | |
| download | ChibiOS-7d689a5fae4f0950c8cb8e291744465ea5d2ca93.tar.gz ChibiOS-7d689a5fae4f0950c8cb8e291744465ea5d2ca93.tar.bz2 ChibiOS-7d689a5fae4f0950c8cb8e291744465ea5d2ca93.zip | |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1242 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/kernel/src')
| -rw-r--r-- | os/kernel/src/chheap.c | 8 | ||||
| -rw-r--r-- | os/kernel/src/chmempools.c | 12 |
2 files changed, 10 insertions, 10 deletions
diff --git a/os/kernel/src/chheap.c b/os/kernel/src/chheap.c index e7a975f3d..d1dab1580 100644 --- a/os/kernel/src/chheap.c +++ b/os/kernel/src/chheap.c @@ -19,8 +19,8 @@ /**
* @file chheap.c
- * @brief Heap code.
- * @addtogroup heap
+ * @brief Heaps code.
+ * @addtogroup heaps
* @{
*/
@@ -47,7 +47,7 @@ static MemoryHeap default_heap;
/**
- * @brief Initializes the allocator subsystem.
+ * @brief Initializes the default heap.
*
* @note Internal use only.
*/
@@ -63,7 +63,7 @@ void heap_init(void) { }
/**
- * @brief Initializes a memory heap.
+ * @brief Initializes a memory heap from a static memory area.
*
* @param[out] heapp pointer to a memory heap descriptor to be initialized
* @param[in] buf heap buffer base
diff --git a/os/kernel/src/chmempools.c b/os/kernel/src/chmempools.c index 76ef39b58..97d619520 100644 --- a/os/kernel/src/chmempools.c +++ b/os/kernel/src/chmempools.c @@ -33,19 +33,19 @@ * @param[out] mp pointer to a @p MemoryPool structure
* @param[in] size the size of the objects contained in this memory pool,
* the minimum accepted size is the size of a pointer to void.
+ * @param[in] provider memory provider function for the memory pool or
+ * @p NULL if the pool is not allowed to grow automatically
*
* @note The size is internally aligned to be a multiple of the @p align_t
* type size.
*/
-void chPoolInit(MemoryPool *mp, size_t size) {
+void chPoolInit(MemoryPool *mp, size_t size, memgetfunc_t provider) {
chDbgCheck((mp != NULL) && (size >= sizeof(void *)), "chPoolInit");
mp->mp_next = NULL;
mp->mp_object_size = MEM_ALIGN_SIZE(size);
-#if CH_USE_MEMCORE
- mp->mp_usecore = FALSE;
-#endif
+ mp->mp_provider = provider;
}
/**
@@ -63,8 +63,8 @@ void *chPoolAllocI(MemoryPool *mp) { if ((objp = mp->mp_next) != NULL)
mp->mp_next = mp->mp_next->ph_next;
#if CH_USE_MEMCORE
- else if (mp->mp_usecore)
- objp = chCoreAllocI(mp->mp_object_size);
+ else if (mp->mp_provider != NULL)
+ objp = mp->mp_provider(mp->mp_object_size);
#endif
return objp;
}
|
