diff options
Diffstat (limited to 'cpukit/posix/src/keyfreememory.c')
-rw-r--r-- | cpukit/posix/src/keyfreememory.c | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/cpukit/posix/src/keyfreememory.c b/cpukit/posix/src/keyfreememory.c deleted file mode 100644 index 0e2c517cc5..0000000000 --- a/cpukit/posix/src/keyfreememory.c +++ /dev/null @@ -1,60 +0,0 @@ -/** - * @file - * - * @brief POSIX Function Keys Free Memory - * @ingroup POSIXAPI - */ - -/* - * Copyright (c) 2012 Zhongwei Yao. - * COPYRIGHT (c) 1989-2010. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#if HAVE_CONFIG_H -#include "config.h" -#endif - -#include <rtems/posix/keyimpl.h> -#include <rtems/score/chainimpl.h> - -void _POSIX_Keys_Free_memory( - POSIX_Keys_Control *the_key -) -{ - POSIX_Keys_Key_value_pair *p; - RBTree_Node *iter, *next; - Objects_Id key_id; - - key_id = the_key->Object.id; - iter = _POSIX_Keys_Find( key_id, 0 ); - if ( !iter ) - return; - /** - * find the smallest thread_id node in the rbtree. - */ - next = _RBTree_Predecessor( iter ); - p = POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( next ); - while ( next != NULL && p->key == key_id) { - iter = next; - next = _RBTree_Predecessor( iter ); - p = POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( next ); - } - - /** - * delete all nodes belongs to the_key from the rbtree and chain. - */ - p = POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( iter ); - while ( iter != NULL && p->key == key_id ) { - next = _RBTree_Successor( iter ); - - _POSIX_Keys_Free_key_value_pair( p ); - - iter = next; - p = POSIX_KEYS_RBTREE_NODE_TO_KEY_VALUE_PAIR( iter ); - } -} |