malloc: Hide RTEMS_Malloc_Sbrk_amount

Move RTEMS_Malloc_Sbrk_amount to the only implementation file which uses
it and make it private to hide implementation-details from an API
header.
This commit is contained in:
Sebastian Huber
2021-04-20 09:58:06 +02:00
parent d8a5e140ec
commit 6c66bbbadf
2 changed files with 7 additions and 7 deletions

View File

@@ -48,12 +48,7 @@ Heap_Control *RTEMS_Malloc_Initialize(
Heap_Initialization_or_extend_handler extend Heap_Initialization_or_extend_handler extend
); );
extern ptrdiff_t RTEMS_Malloc_Sbrk_amount; void rtems_heap_set_sbrk_amount( ptrdiff_t sbrk_amount );
static inline void rtems_heap_set_sbrk_amount( ptrdiff_t sbrk_amount )
{
RTEMS_Malloc_Sbrk_amount = sbrk_amount;
}
typedef void *(*rtems_heap_extend_handler)( typedef void *(*rtems_heap_extend_handler)(
Heap_Control *heap, Heap_Control *heap,

View File

@@ -29,7 +29,12 @@
#include "malloc_p.h" #include "malloc_p.h"
ptrdiff_t RTEMS_Malloc_Sbrk_amount; static ptrdiff_t RTEMS_Malloc_Sbrk_amount;
void rtems_heap_set_sbrk_amount( ptrdiff_t sbrk_amount )
{
RTEMS_Malloc_Sbrk_amount = sbrk_amount;
}
void *rtems_heap_extend_via_sbrk( void *rtems_heap_extend_via_sbrk(
Heap_Control *heap, Heap_Control *heap,