From 622d6703d3b332ef56d7691b16d3f74959f6ebf8 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 17 Feb 2012 13:42:51 +0100 Subject: 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. --- cpukit/rtems/include/rtems/rtems/support.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'cpukit/rtems/include/rtems/rtems/support.h') 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__ -- cgit v1.2.3