summaryrefslogtreecommitdiffstats
path: root/cpukit/score/inline/rtems/score/object.inl
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-11-07 23:26:44 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-11-07 23:26:44 +0000
commitf2e4e671601106a83fc8bd25b86537e0921ad1b6 (patch)
treece0c46eaca88367295a657b655bb9ae290f05486 /cpukit/score/inline/rtems/score/object.inl
parent2007-11-07 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-f2e4e671601106a83fc8bd25b86537e0921ad1b6.tar.bz2
2007-11-07 Joel Sherrill <joel.sherrill@OARcorp.com>
* score/inline/rtems/score/object.inl: During test coverage analysis, we identified this sanity check which should have been conditional on RTEMS_DEBUG since it can NOT be tripped during normal RTEMS operations. With all APIs enabled, this saved 352 bytes from the minimum executable on the SPARC/ERC32.
Diffstat (limited to 'cpukit/score/inline/rtems/score/object.inl')
-rw-r--r--cpukit/score/inline/rtems/score/object.inl20
1 files changed, 17 insertions, 3 deletions
diff --git a/cpukit/score/inline/rtems/score/object.inl b/cpukit/score/inline/rtems/score/object.inl
index a70d7ddadc..891f968d86 100644
--- a/cpukit/score/inline/rtems/score/object.inl
+++ b/cpukit/score/inline/rtems/score/object.inl
@@ -7,7 +7,7 @@
* This include file contains the static inline implementation of all
* of the inlined routines in the Object Handler.
*
- * COPYRIGHT (c) 1989-2006.
+ * COPYRIGHT (c) 1989-2007.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -200,6 +200,11 @@ RTEMS_INLINE_ROUTINE Objects_Control *_Objects_Get_local_object(
* @param[in] information points to an Object Information Table
* @param[in] index is the index of the object the caller wants to access
* @param[in] the_object is the local object pointer
+ *
+ * @note This routine is ONLY to be called in places where the
+ * index portion of the Id is known to be good. This is
+ * OK since it is normally called from object create/init
+ * or delete/destroy operations.
*/
RTEMS_INLINE_ROUTINE void _Objects_Set_local_object(
@@ -208,8 +213,17 @@ RTEMS_INLINE_ROUTINE void _Objects_Set_local_object(
Objects_Control *the_object
)
{
- if ( index <= information->maximum )
- information->local_table[ index ] = the_object;
+ /*
+ * This routine is ONLY to be called from places in the code
+ * where the Id is known to be good. Therefore, this should NOT
+ * occur in normal situations.
+ */
+ #if defined(RTEMS_DEBUG)
+ if ( index > information->maximum )
+ return;
+ #endif
+
+ information->local_table[ index ] = the_object;
}
/**