summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/objectnamespaceremove.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-02-06 23:54:55 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-02-06 23:54:55 +0000
commit9184270ac4ab137526cf15627d925cafcd3b3a52 (patch)
treec600d43831b5893e9fea4806eec6a9522f26057b /cpukit/score/src/objectnamespaceremove.c
parent2008-02-06 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-9184270ac4ab137526cf15627d925cafcd3b3a52.tar.bz2
2008-02-06 Joel Sherrill <joel.sherrill@oarcorp.com>
* posix/src/mqueueunlink.c, score/Makefile.am, score/include/rtems/score/object.h, score/inline/rtems/score/object.inl: Enhance _Objects_Namespace_remove() to handle freeing object names which are strings. All changed _Objects_Close() to call _Objects_Namespace_remove(). The resulting code was then moved from inline routines to function calls. * score/src/objectclose.c, score/src/objectnamespaceremove.c: New files.
Diffstat (limited to 'cpukit/score/src/objectnamespaceremove.c')
-rw-r--r--cpukit/score/src/objectnamespaceremove.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/cpukit/score/src/objectnamespaceremove.c b/cpukit/score/src/objectnamespaceremove.c
new file mode 100644
index 0000000000..df54d854ac
--- /dev/null
+++ b/cpukit/score/src/objectnamespaceremove.c
@@ -0,0 +1,36 @@
+/*
+ * COPYRIGHT (c) 1989-2008.
+ * 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.com/license/LICENSE.
+ *
+ * $Id$
+ */
+
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <rtems/system.h>
+#include <rtems/score/object.h>
+#include <rtems/score/wkspace.h>
+
+void _Objects_Namespace_remove(
+ Objects_Information *information,
+ Objects_Control *the_object
+)
+{
+ /*
+ * If this is a string format name, then free the memory.
+ */
+ if ( information->is_string && the_object->name.name_p )
+ _Workspace_Free( (void *)the_object->name.name_p );
+
+ /*
+ * Clear out either format.
+ */
+ the_object->name.name_p = NULL;
+ the_object->name.name_u32 = 0;
+}