forked from Imagelibrary/rtems
Corrected to account for the way memory is divided up in
_Object_Extend_information. This change is a side-effect of the change made to that file to fix an alignment problem.
This commit is contained in:
@@ -43,25 +43,27 @@ Objects_Control *_Objects_Allocate_by_index(
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
Objects_Control *the_object;
|
Objects_Control *the_object;
|
||||||
void *p;
|
|
||||||
|
|
||||||
if ( index && information->maximum >= index ) {
|
if ( index && information->maximum >= index ) {
|
||||||
|
/*
|
||||||
|
* If the object is already in the local table, then
|
||||||
|
* it has already been allocated/created by a previous
|
||||||
|
* create call.
|
||||||
|
*/
|
||||||
|
|
||||||
the_object = _Objects_Get_local_object( information, index );
|
the_object = _Objects_Get_local_object( information, index );
|
||||||
if ( the_object )
|
if ( the_object )
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* XXX
|
/* XXX
|
||||||
* This whole section of code needs to be addressed.
|
* This whole section of code needs to be addressed.
|
||||||
* + The 0 should be dealt with more properly so we can autoextend.
|
* + The use of the index 0 for object_blocks should be dealt
|
||||||
* + The pointer arithmetic is probably too expensive.
|
* with more properly so we can autoextend.
|
||||||
* + etc.
|
* + etc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
p = _Addresses_Add_offset( information->object_blocks[ 0 ],
|
the_object = (Objects_Control *) information->object_blocks[ 0 ];
|
||||||
(information->allocation_size * information->name_length) ),
|
|
||||||
|
|
||||||
p = _Addresses_Add_offset( p, (sizeof_control * (index - 1)) );
|
|
||||||
the_object = (Objects_Control *)p;
|
|
||||||
_Chain_Extract( &the_object->Node );
|
_Chain_Extract( &the_object->Node );
|
||||||
|
|
||||||
return the_object;
|
return the_object;
|
||||||
|
|||||||
@@ -43,25 +43,27 @@ Objects_Control *_Objects_Allocate_by_index(
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
Objects_Control *the_object;
|
Objects_Control *the_object;
|
||||||
void *p;
|
|
||||||
|
|
||||||
if ( index && information->maximum >= index ) {
|
if ( index && information->maximum >= index ) {
|
||||||
|
/*
|
||||||
|
* If the object is already in the local table, then
|
||||||
|
* it has already been allocated/created by a previous
|
||||||
|
* create call.
|
||||||
|
*/
|
||||||
|
|
||||||
the_object = _Objects_Get_local_object( information, index );
|
the_object = _Objects_Get_local_object( information, index );
|
||||||
if ( the_object )
|
if ( the_object )
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* XXX
|
/* XXX
|
||||||
* This whole section of code needs to be addressed.
|
* This whole section of code needs to be addressed.
|
||||||
* + The 0 should be dealt with more properly so we can autoextend.
|
* + The use of the index 0 for object_blocks should be dealt
|
||||||
* + The pointer arithmetic is probably too expensive.
|
* with more properly so we can autoextend.
|
||||||
* + etc.
|
* + etc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
p = _Addresses_Add_offset( information->object_blocks[ 0 ],
|
the_object = (Objects_Control *) information->object_blocks[ 0 ];
|
||||||
(information->allocation_size * information->name_length) ),
|
|
||||||
|
|
||||||
p = _Addresses_Add_offset( p, (sizeof_control * (index - 1)) );
|
|
||||||
the_object = (Objects_Control *)p;
|
|
||||||
_Chain_Extract( &the_object->Node );
|
_Chain_Extract( &the_object->Node );
|
||||||
|
|
||||||
return the_object;
|
return the_object;
|
||||||
|
|||||||
Reference in New Issue
Block a user