mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-11-16 12:34:45 +00:00
2005-05-13 Jennifer Averett <jennifer.averett@oarcorp.com>
PR 786/rtems
Backport mallocfreespace optimization.
* Makefile.am, include/rtems/rtems/region.h:
* src/regiongetfreeinfo.c: New file.
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
2005-05-13 Jennifer Averett <jennifer.averett@oarcorp.com>
|
||||
|
||||
PR 786/rtems
|
||||
Backport mallocfreespace optimization.
|
||||
* Makefile.am, include/rtems/rtems/region.h:
|
||||
* src/regiongetfreeinfo.c: New file.
|
||||
|
||||
2005-03-17 Joel Sherrill <joel@OARcorp.com>
|
||||
|
||||
PR 692/rtems
|
||||
|
||||
@@ -118,7 +118,7 @@ SIGNAL_C_FILES = src/signal.c src/signalcatch.c src/signalsend.c
|
||||
|
||||
REGION_C_FILES = src/region.c src/regioncreate.c src/regiondelete.c src/regionextend.c \
|
||||
src/regiongetsegment.c src/regiongetsegmentsize.c src/regionident.c \
|
||||
src/regionreturnsegment.c src/regiongetinfo.c
|
||||
src/regionreturnsegment.c src/regiongetinfo.c src/regiongetfreeinfo.c
|
||||
|
||||
PARTITION_C_FILES = src/part.c src/partcreate.c src/partdelete.c src/partgetbuffer.c \
|
||||
src/partident.c src/partreturnbuffer.c
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include <rtems/score/object.h>
|
||||
#include <rtems/score/threadq.h>
|
||||
#include <rtems/score/heap.h>
|
||||
@@ -143,6 +145,21 @@ rtems_status_code rtems_region_get_information(
|
||||
Heap_Information_block *the_info
|
||||
);
|
||||
|
||||
/*
|
||||
* rtems_region_get_free_information
|
||||
*
|
||||
* DESCRIPTION:
|
||||
*
|
||||
* This routine implements the rtems_region_get_free_information directive.
|
||||
* This directive returns information about the free blocks in the
|
||||
* heap associated with this region.
|
||||
*/
|
||||
|
||||
rtems_status_code rtems_region_get_free_information(
|
||||
Objects_Id id,
|
||||
Heap_Information *the_info
|
||||
);
|
||||
|
||||
/*
|
||||
* rtems_region_delete
|
||||
*
|
||||
|
||||
@@ -12,10 +12,6 @@
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <rtems/system.h>
|
||||
#include <rtems/rtems/status.h>
|
||||
#include <rtems/rtems/support.h>
|
||||
@@ -39,14 +35,14 @@
|
||||
* the_info - pointer to region information block
|
||||
*
|
||||
* Output parameters:
|
||||
* *the_info - region information block filled in
|
||||
* *the_info - region information block filled in
|
||||
* RTEMS_SUCCESSFUL - if successful
|
||||
* error code - if unsuccessful
|
||||
* error code - if unsuccessful
|
||||
*/
|
||||
|
||||
rtems_status_code rtems_region_get_free_information(
|
||||
Objects_Id id,
|
||||
Heap_Information_block *the_info
|
||||
Objects_Id id,
|
||||
Heap_Information *the_info
|
||||
)
|
||||
{
|
||||
register Region_Control *the_region;
|
||||
@@ -68,11 +64,11 @@ rtems_status_code rtems_region_get_free_information(
|
||||
|
||||
case OBJECTS_LOCAL:
|
||||
|
||||
the_info->Used.number = 0;
|
||||
the_info->Used.total = 0;
|
||||
the_info->Used.largest = 0;
|
||||
the_info->number = 0;
|
||||
the_info->total = 0;
|
||||
the_info->largest = 0;
|
||||
|
||||
_Heap_Get_free_information( &the_region->Memory, &the_info->Free );
|
||||
_Heap_Get_free_information( &the_region->Memory, the_info );
|
||||
|
||||
_RTEMS_Unlock_allocator();
|
||||
return RTEMS_SUCCESSFUL;
|
||||
|
||||
Reference in New Issue
Block a user