18 #ifndef _RTEMS_SCORE_HEAP_H 19 #define _RTEMS_SCORE_HEAP_H 29 #define HEAP_PROTECTION 193 #ifndef HEAP_PROTECTION 194 #define HEAP_PROTECTION_HEADER_SIZE 0 196 #define HEAP_PROTECTOR_COUNT 2 198 #define HEAP_BEGIN_PROTECTOR_0 ((uintptr_t) 0xfd75a98f) 199 #define HEAP_BEGIN_PROTECTOR_1 ((uintptr_t) 0xbfa1f177) 200 #define HEAP_END_PROTECTOR_0 ((uintptr_t) 0xd6b8855e) 201 #define HEAP_END_PROTECTOR_1 ((uintptr_t) 0x13a44a5b) 203 #define HEAP_FREE_PATTERN ((uintptr_t) 0xe7093cdf) 205 #define HEAP_PROTECTION_OBOLUS ((Heap_Block *) 1) 207 typedef void (*_Heap_Protection_handler)(
212 typedef void (*_Heap_Protection_error_handler)(
219 _Heap_Protection_handler block_initialize;
220 _Heap_Protection_handler block_check;
221 _Heap_Protection_error_handler block_error;
225 uintptr_t delayed_free_block_count;
226 uintptr_t delayed_free_fraction;
232 uintptr_t protector [HEAP_PROTECTOR_COUNT];
236 } Heap_Protection_block_begin;
239 uintptr_t protector [HEAP_PROTECTOR_COUNT];
240 } Heap_Protection_block_end;
242 #define HEAP_PROTECTION_HEADER_SIZE \ 243 (sizeof(Heap_Protection_block_begin) + sizeof(Heap_Protection_block_end)) 250 #define HEAP_BLOCK_HEADER_SIZE \ 251 (2 * sizeof(uintptr_t) + HEAP_PROTECTION_HEADER_SIZE) 272 #ifdef HEAP_PROTECTION 273 Heap_Protection_block_begin Protection_begin;
291 #ifdef HEAP_PROTECTION 292 Heap_Protection_block_end Protection_end;
321 uintptr_t min_block_size;
322 uintptr_t area_begin;
327 #ifdef HEAP_PROTECTION 328 Heap_Protection Protection;
356 uintptr_t page_size_or_unused
418 uintptr_t remainder = value % alignment;
420 if ( remainder != 0 ) {
421 return value - remainder + alignment;
450 if ( page_size != 0 ) {
475 if ( page_size != 0 ) {
481 if ( page_size < alignment ) {
482 page_size = alignment;
Run-time heap statistics.
There is was an attempt to free the same block twice.
uintptr_t size_and_flag
Contains the size of the current block and a flag which indicates if the previous block is free or us...
uintptr_t _Heap_Extend(Heap_Control *heap, void *area_begin, uintptr_t area_size, uintptr_t unused)
Extends the memory available for the heap.
The next block of a supposed to be used block does not indicate that the block is used...
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up(uintptr_t value, uintptr_t alignment)
Aligns the value to a given alignment, rounding up.
There is an unexpected value in the heap block protector area.
Heap area structure for table based heap initialization and extension.
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Min_block_size(uintptr_t page_size)
Returns the minimal Heap Block size for the given page_size.
Description for free or used blocks.
A supposed to be free block is not inside the heap memory area.
Heap Handler Information API.
uintptr_t _Heap_No_extend(Heap_Control *unused_0, void *unused_1, uintptr_t unused_2, uintptr_t unused_3)
This function returns always zero.
Control block used to manage a heap.
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Size_with_overhead(uintptr_t page_size, uintptr_t size, uintptr_t alignment)
Returns the size with administration and alignment overhead for one allocation.
SPARC CPU Department Source.
RTEMS_INLINE_ROUTINE uintptr_t _Heap_Area_overhead(uintptr_t page_size)
Returns the worst case overhead to manage a memory area.
Heap_Error_reason reason
The heap error reason.
Heap_Error_reason
The heap error reason.
Heap_Block * next
Pointer to the next free block or part of the allocated area.
uintptr_t prev_size
Size of the previous block or part of the allocated area of the previous block.
Heap_Block * block
The heap block causing the error.
Heap_Control * heap
The heap of the block.
#define RTEMS_INLINE_ROUTINE
Gives a hint to the compiler in a function declaration to inline this function.
Heap_Block * prev
Pointer to the previous free block or part of the allocated area.
#define HEAP_BLOCK_HEADER_SIZE
The block header consists of the two size fields (Heap_Block::prev_size and Heap_Block::size_and_flag...
uintptr_t(* Heap_Initialization_or_extend_handler)(Heap_Control *heap, void *area_begin, uintptr_t area_size, uintptr_t page_size_or_unused)
Heap initialization and extend handler type.
There is an unexpected value in the free pattern of a free heap block.