diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-08-06 15:28:59 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-08-08 14:11:21 +0200 |
commit | c9b784f3e75d74e251eb68a978e832b37279ff66 (patch) | |
tree | b32525ba63aa53bb621828e71ca01c5583976068 /cpukit/posix/include/rtems/posix/keyimpl.h | |
parent | bsp/xilinx_zynq_zc706: Add. (diff) | |
download | rtems-c9b784f3e75d74e251eb68a978e832b37279ff66.tar.bz2 |
posix: Delete POSIX_Keys_Freechain type
Use the POSIX configuration value directly. Use right type early and
avoid casts. Use proper unlimited objects API. Check workspace
allocation. Make functions static.
Diffstat (limited to 'cpukit/posix/include/rtems/posix/keyimpl.h')
-rw-r--r-- | cpukit/posix/include/rtems/posix/keyimpl.h | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/cpukit/posix/include/rtems/posix/keyimpl.h b/cpukit/posix/include/rtems/posix/keyimpl.h index b6b34b21dd..f01eda4de3 100644 --- a/cpukit/posix/include/rtems/posix/keyimpl.h +++ b/cpukit/posix/include/rtems/posix/keyimpl.h @@ -35,14 +35,6 @@ extern "C" { */ /** - * @brief POSIX_Keys_Freechain is used in Freechain structure - */ -typedef struct { - Freechain_Control super_fc; - size_t bump_count; -} POSIX_Keys_Freechain; - -/** * @brief The information control block used to manage this class of objects. */ POSIX_EXTERN Objects_Information _POSIX_Keys_Information; @@ -55,7 +47,7 @@ POSIX_EXTERN RBTree_Control _POSIX_Keys_Key_value_lookup_tree; /** * @brief This freechain is used as a memory pool for POSIX_Keys_Key_value_pair. */ -POSIX_EXTERN POSIX_Keys_Freechain _POSIX_Keys_Keypool; +POSIX_EXTERN Freechain_Control _POSIX_Keys_Keypool; /** * @brief POSIX key manager initialization. @@ -65,14 +57,6 @@ POSIX_EXTERN POSIX_Keys_Freechain _POSIX_Keys_Keypool; void _POSIX_Key_Manager_initialization(void); /** - * @brief POSIX key Freechain extend handle - * - * This routine extend freechain node, which is called in freechain_get - * automatically. - */ -bool _POSIX_Keys_Freechain_extend(Freechain_Control *freechain); - -/** * @brief POSIX keys Red-Black tree node comparison. * * This routine compares the rbtree node @@ -168,6 +152,19 @@ RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Get ( _Objects_Get( &_POSIX_Keys_Information, (Objects_Id) id, location ); } +RTEMS_INLINE_ROUTINE POSIX_Keys_Key_value_pair * +_POSIX_Keys_Key_value_pair_allocate( void ) +{ + return (POSIX_Keys_Key_value_pair *) _Freechain_Get( &_POSIX_Keys_Keypool ); +} + +RTEMS_INLINE_ROUTINE void _POSIX_Keys_Key_value_pair_free( + POSIX_Keys_Key_value_pair *key_value_pair +) +{ + _Freechain_Put( &_POSIX_Keys_Keypool, key_value_pair ); +} + /** @} */ #ifdef __cplusplus |