RTEMS  5.0.0
Files | Functions | Variables
Workspace Handler

Files

file  wkspace.c
 Workspace Handler Support.
 
file  wkstringduplicate.c
 Duplicates String with Memory from the Workspace.
 

Functions

void _Workspace_Handler_initialization (Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend)
 Initilize workspace handler. More...
 
void * _Workspace_Allocate (size_t size)
 Allocate memory from workspace. More...
 
void * _Workspace_Allocate_aligned (size_t size, size_t alignment)
 Allocate aligned memory from workspace. More...
 
void _Workspace_Free (void *block)
 Free memory to the workspace. More...
 
void * _Workspace_Allocate_or_fatal_error (size_t size)
 Workspace allocate or fail with fatal error. More...
 
char * _Workspace_String_duplicate (const char *string, size_t len)
 Duplicates string with memory from the workspace. More...
 

Variables

Heap_Control _Workspace_Area
 Executive workspace control. More...
 

Detailed Description

This handler encapsulates functionality related to the management of the RTEMS Executive Workspace.

Function Documentation

◆ _Workspace_Allocate()

void* _Workspace_Allocate ( size_t  size)

Allocate memory from workspace.

This routine returns the address of a block of memory of size bytes. If a block of the appropriate size cannot be allocated from the workspace, then NULL is returned.

Parameters
sizeis the requested size
Return values
apointer to the requested memory or NULL.

◆ _Workspace_Allocate_aligned()

void* _Workspace_Allocate_aligned ( size_t  size,
size_t  alignment 
)

Allocate aligned memory from workspace.

Parameters
[in]sizeThe size of the requested memory.
[in]alignmentThe alignment of the requested memory.
Return values
NULLNot enough resources.
otherThe memory area begin.

◆ _Workspace_Allocate_or_fatal_error()

void* _Workspace_Allocate_or_fatal_error ( size_t  size)

Workspace allocate or fail with fatal error.

This routine returns the address of a block of memory of size bytes. If a block of the appropriate size cannot be allocated from the workspace, then the internal error handler is invoked.

Parameters
[in]sizeis the desired number of bytes to allocate
Return values
Ifsuccessful, the starting address of the allocated memory

◆ _Workspace_Free()

void _Workspace_Free ( void *  block)

Free memory to the workspace.

This function frees the specified block of memory. If the block belongs to the Workspace and can be successfully freed, then true is returned. Otherwise false is returned.

Parameters
blockis the memory to free
Note
If block is equal to NULL, then the request is ignored. This allows the caller to not worry about whether or not a pointer is NULL.

◆ _Workspace_Handler_initialization()

void _Workspace_Handler_initialization ( Heap_Area areas,
size_t  area_count,
Heap_Initialization_or_extend_handler  extend 
)

Initilize workspace handler.

This routine performs the initialization necessary for this handler.

◆ _Workspace_String_duplicate()

char* _Workspace_String_duplicate ( const char *  string,
size_t  len 
)

Duplicates string with memory from the workspace.

Parameters
[in]stringis the pointer to a zero terminated string.
[in]lenis the length of the string (equal to strlen(string)).
Return values
NULLNot enough memory.
otherDuplicated string.

Variable Documentation

◆ _Workspace_Area

Heap_Control _Workspace_Area

Executive workspace control.

This is the heap control structure used to manage the RTEMS Executive Workspace.