summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/include/rtems/rtems
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2012-02-17 13:42:51 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2012-02-17 16:10:17 +0100
commit622d6703d3b332ef56d7691b16d3f74959f6ebf8 (patch)
treec9d81e24446969d5ff51b7bad835c92353b613c3 /cpukit/rtems/include/rtems/rtems
parentRemove (Moved to git.rtems.org/data/git/rtems-crossrpms.git). (diff)
downloadrtems-622d6703d3b332ef56d7691b16d3f74959f6ebf8.tar.bz2
Add functions for greedy workspace allocation
Various tests must check program paths that result due to failed memory allocations from the workspace. To avoid tinkering with internal workspace structures throughout the test code these functions should be used.
Diffstat (limited to '')
-rw-r--r--cpukit/rtems/include/rtems/rtems/support.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/cpukit/rtems/include/rtems/rtems/support.h b/cpukit/rtems/include/rtems/rtems/support.h
index 220411d984..08c911d7e6 100644
--- a/cpukit/rtems/include/rtems/rtems/support.h
+++ b/cpukit/rtems/include/rtems/rtems/support.h
@@ -101,6 +101,24 @@ bool rtems_workspace_free(
void *pointer
);
+/**
+ * @brief Greedy allocate that empties the workspace.
+ *
+ * Afterward the workspace has at most @a remaining_free_space free space left
+ * in one free block. All other blocks are used.
+ *
+ * @see rtems_workspace_greedy_free().
+ */
+void *rtems_workspace_greedy_allocate( size_t remaining_free_space );
+
+/**
+ * @brief Frees space of a greedy allocation.
+ *
+ * The @a opaque argument must be the return value of
+ * rtems_workspace_greedy_allocate().
+ */
+void rtems_workspace_greedy_free( void *opaque );
+
/** @} */
#ifndef __RTEMS_APPLICATION__