diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-11-12 15:54:48 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-11-12 15:54:48 +0000 |
commit | 6af8143502b8de4a58e7c4782c8c28a86b180459 (patch) | |
tree | e7c7c31b7dc2b7c2df6ae6e771e47530fab1d6ea /c | |
parent | Corrected remaining references to struct rtems_task_variable_t since (diff) | |
download | rtems-6af8143502b8de4a58e7c4782c8c28a86b180459.tar.bz2 |
Corrected so now actually indexes into the allocation block.
Diffstat (limited to '')
-rw-r--r-- | c/src/exec/score/src/objectallocatebyindex.c | 16 | ||||
-rw-r--r-- | cpukit/score/src/objectallocatebyindex.c | 16 |
2 files changed, 12 insertions, 20 deletions
diff --git a/c/src/exec/score/src/objectallocatebyindex.c b/c/src/exec/score/src/objectallocatebyindex.c index 8c8528606d..043d41978e 100644 --- a/c/src/exec/score/src/objectallocatebyindex.c +++ b/c/src/exec/score/src/objectallocatebyindex.c @@ -45,25 +45,21 @@ Objects_Control *_Objects_Allocate_by_index( Objects_Control *the_object; 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 ); if ( the_object ) return NULL; /* XXX * This whole section of code needs to be addressed. - * + The use of the index 0 for object_blocks should be dealt - * with more properly so we can autoextend. + * + The 0 should be dealt with more properly so we can autoextend. + * + The pointer arithmetic is probably too expensive. * + etc. */ - the_object = (Objects_Control *) information->object_blocks[ 0 ]; - + the_object = (Objects_Control *) _Addresses_Add_offset( + information->object_blocks[ 0 ], + (sizeof_control * (index - 1)) + ); _Chain_Extract( &the_object->Node ); return the_object; diff --git a/cpukit/score/src/objectallocatebyindex.c b/cpukit/score/src/objectallocatebyindex.c index 8c8528606d..043d41978e 100644 --- a/cpukit/score/src/objectallocatebyindex.c +++ b/cpukit/score/src/objectallocatebyindex.c @@ -45,25 +45,21 @@ Objects_Control *_Objects_Allocate_by_index( Objects_Control *the_object; 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 ); if ( the_object ) return NULL; /* XXX * This whole section of code needs to be addressed. - * + The use of the index 0 for object_blocks should be dealt - * with more properly so we can autoextend. + * + The 0 should be dealt with more properly so we can autoextend. + * + The pointer arithmetic is probably too expensive. * + etc. */ - the_object = (Objects_Control *) information->object_blocks[ 0 ]; - + the_object = (Objects_Control *) _Addresses_Add_offset( + information->object_blocks[ 0 ], + (sizeof_control * (index - 1)) + ); _Chain_Extract( &the_object->Node ); return the_object; |