forked from Imagelibrary/rtems
Use alternative API
Replaced Allocate_majority_of_workspace() with rtems_workspace_allocate(). Replaced Allocate_majority_of_heap() with rtems_heap_greedy_allocate().
This commit is contained in:
@@ -40,42 +40,3 @@ const char *Get_Longest_Name(void)
|
||||
Longest_Name[i] = '\0';
|
||||
return Longest_Name;
|
||||
}
|
||||
|
||||
void Allocate_majority_of_workspace( int smallest )
|
||||
{
|
||||
bool result;
|
||||
Heap_Information_block info;
|
||||
void *temp;
|
||||
|
||||
puts("Allocate_majority_of_workspace: ");
|
||||
result = rtems_workspace_get_information( &info );
|
||||
if ( result != TRUE )
|
||||
perror("==> Error Getting workspace information");
|
||||
|
||||
do {
|
||||
result = rtems_workspace_allocate(
|
||||
info.Free.largest - HEAP_BLOCK_HEADER_SIZE,
|
||||
&temp
|
||||
);
|
||||
if ((!result) || (!temp))
|
||||
perror("Unable to allocate from workspace");
|
||||
result = rtems_workspace_get_information( &info );
|
||||
} while ( info.Free.largest >= smallest );
|
||||
|
||||
}
|
||||
|
||||
void Allocate_majority_of_heap( int smallest )
|
||||
{
|
||||
size_t size;
|
||||
void *temp;
|
||||
|
||||
puts("Allocate_majority_of_heap: ");
|
||||
size = malloc_free_space();
|
||||
do {
|
||||
temp = malloc( size - HEAP_BLOCK_HEADER_SIZE );
|
||||
if (!temp)
|
||||
perror("Unable to allocate from workspace");
|
||||
size = malloc_free_space();
|
||||
} while ( size >= smallest );
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user