diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-02-17 13:42:51 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2012-02-17 16:10:17 +0100 |
commit | 622d6703d3b332ef56d7691b16d3f74959f6ebf8 (patch) | |
tree | c9d81e24446969d5ff51b7bad835c92353b613c3 /cpukit/rtems/include | |
parent | Remove (Moved to git.rtems.org/data/git/rtems-crossrpms.git). (diff) | |
download | rtems-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.h | 18 |
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__ |