33 Malloc_System_state _Malloc_System_state(
void )
39 return MALLOC_SYSTEM_STATE_NORMAL;
41 return MALLOC_SYSTEM_STATE_NO_ALLOCATION;
44 return MALLOC_SYSTEM_STATE_NORMAL;
46 return MALLOC_SYSTEM_STATE_NO_PROTECTION;
50 RTEMS_WEAK void _Malloc_Process_deferred_frees(
void )
67 switch ( _Malloc_System_state() ) {
68 case MALLOC_SYSTEM_STATE_NORMAL:
69 _RTEMS_Lock_allocator();
70 _Malloc_Process_deferred_frees();
77 _RTEMS_Unlock_allocator();
79 case MALLOC_SYSTEM_STATE_NO_PROTECTION:
94 if ( p == NULL && alignment == 0 && boundary == 0 ) {
95 p = (*rtems_malloc_extend_handler)( heap, size );
101 if ( p != NULL && rtems_malloc_dirty_helper != NULL )
102 (*rtems_malloc_dirty_helper)( p, size );
121 length = nelem * elsize;
128 return memset( p, 0, length );
#define RTEMS_WEAK
Tells the compiler in a function definition that this function should be weak.
System_state_Codes
System states.
static __inline__ bool _System_state_Is_up(System_state_Codes state)
Checks if the state is up.
void * rtems_malloc(size_t size) RTEMS_MALLOCLIKE RTEMS_ALLOC_SIZE(1) RTEMS_WARN_UNUSED_RESULT
Allocates a memory area of the specified size from the heap.
#define RTEMS_PREDICT_FALSE(_exp)
Returns the value of the specified integral expression and tells the compiler that the predicted valu...
Constants and Structures Related with Thread Dispatch.
void * rtems_calloc(size_t nelem, size_t elsize) RTEMS_MALLOCLIKE RTEMS_ALLOC_SIZE_2(1
Allocates a memory area for the specified count of elements from the heap.
static __inline__ bool _System_state_Is_before_multitasking(System_state_Codes state)
Checks if the state is before multitasking.
static __inline__ bool _Thread_Dispatch_is_enabled(void)
Indicates if the executing thread is inside a thread dispatch critical section.
Control block used to manage a heap.
Heap_Control * RTEMS_Malloc_Heap
C program heap control.
#define RTEMS_OBFUSCATE_VARIABLE(_var)
Obfuscates the variable so that the compiler cannot perform optimizations based on the variable value...
static __inline__ System_state_Codes _System_state_Get(void)
Gets the current system state.
System State Handler API.
void * rtems_heap_allocate_aligned_with_boundary(size_t size, uintptr_t alignment, uintptr_t boundary) RTEMS_MALLOCLIKE RTEMS_ALLOC_SIZE(1) RTEMS_ALLOC_ALIGN(2) RTEMS_WARN_UNUSED_RESULT
Allocates a memory area of size size bytes from the heap.
void * _Heap_Allocate_aligned_with_boundary(Heap_Control *heap, uintptr_t size, uintptr_t alignment, uintptr_t boundary)
Allocates an aligned memory area with boundary constraint.