RTEMS  5.1
Files | Functions
Workspace

Files

file  support.h
 
file  workspace.c
 RTEMS Workspace Support.
 

Functions

bool rtems_workspace_get_information (Heap_Information_block *the_info)
 Gets Workspace Information. More...
 
bool rtems_workspace_allocate (size_t bytes, void **pointer)
 Allocates Memory from the Workspace. More...
 
bool rtems_workspace_free (void *pointer)
 Frees Memory Allocated from the Workspace. More...
 
void * rtems_workspace_greedy_allocate (const uintptr_t *block_sizes, size_t block_count)
 Greedy allocate that empties the workspace. More...
 
void * rtems_workspace_greedy_allocate_all_except_largest (uintptr_t *allocatable_size)
 Greedy allocate all blocks except the largest free block. More...
 
void rtems_workspace_greedy_free (void *opaque)
 Frees space of a greedy allocation. More...
 

Detailed Description

Workspace definitions.

Function Documentation

◆ rtems_workspace_allocate()

bool rtems_workspace_allocate ( size_t  bytes,
void **  pointer 
)

Allocates Memory from the Workspace.

A number of bytes bytes will be allocated from the RTEMS Executive Workspace and returned in pointer.

Returns true if successful, and false otherwise.

◆ rtems_workspace_free()

bool rtems_workspace_free ( void *  pointer)

Frees Memory Allocated from the Workspace.

This frees the memory indicated by pointer that was allocated from the RTEMS Executive Workspace.

Returns true if successful, and false otherwise.

◆ rtems_workspace_get_information()

bool rtems_workspace_get_information ( Heap_Information_block the_info)

Gets Workspace Information.

Returns information about the heap that is used as the RTEMS Executive Workspace in the_info.

Returns true if successful, and false otherwise.

◆ rtems_workspace_greedy_allocate()

void* rtems_workspace_greedy_allocate ( const uintptr_t *  block_sizes,
size_t  block_count 
)

Greedy allocate that empties the workspace.

Afterwards the heap has at most block_count allocatable blocks of sizes specified by block_sizes. The block_sizes must point to an array with block_count members. All other blocks are used.

See also
rtems_workspace_greedy_free().

◆ rtems_workspace_greedy_allocate_all_except_largest()

void* rtems_workspace_greedy_allocate_all_except_largest ( uintptr_t *  allocatable_size)

Greedy allocate all blocks except the largest free block.

Afterwards the heap has at most one allocatable block. This block is the largest free block if it exists. The allocatable size of this block is stored in allocatable_size. All other blocks are used.

See also
rtems_workspace_greedy_free().

◆ rtems_workspace_greedy_free()

void rtems_workspace_greedy_free ( void *  opaque)

Frees space of a greedy allocation.

The opaque argument must be the return value of rtems_workspace_greedy_allocate() or rtems_workspace_greedy_allocate_all_except_largest().