summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/malloc.h
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2021-02-09 12:48:07 +1100
committerChris Johns <chrisj@rtems.org>2021-02-10 17:28:32 +1100
commit03dff2019f6972f9b202b15d57ab295d706d86cd (patch)
tree6e05487294aa5950f24ad7a17dc319ec7d19df0c /cpukit/include/rtems/malloc.h
parentbsp/riscv: Re-license to BSD-2-Clause (diff)
downloadrtems-03dff2019f6972f9b202b15d57ab295d706d86cd.tar.bz2
libcsupport: Add sbrk greedy support to consume all sbrk memory
- Move the heap sbrk code into a separate routnine. - Update heap and workspace greedy allocators to use the common sbrk greedy support. Closes #3982
Diffstat (limited to 'cpukit/include/rtems/malloc.h')
-rw-r--r--cpukit/include/rtems/malloc.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/cpukit/include/rtems/malloc.h b/cpukit/include/rtems/malloc.h
index 13e94ac38a..ec6473a703 100644
--- a/cpukit/include/rtems/malloc.h
+++ b/cpukit/include/rtems/malloc.h
@@ -68,6 +68,19 @@ void *rtems_heap_extend_via_sbrk(
size_t alloc_size
);
+/**
+ * @brief Greedy allocate that empties the sbrk memory
+ *
+ * Afterwards all the sbrk avialable memory will have been allocated
+ * to the provided heap.
+ *
+ * @see rtems_heap_extend_via_sbrk().
+ */
+void rtems_heap_sbrk_greedy_allocate(
+ Heap_Control *heap,
+ size_t alloc_size
+);
+
void *rtems_heap_null_extend(
Heap_Control *heap,
size_t alloc_size