summaryrefslogtreecommitdiff
path: root/src/object.c
diff options
context:
space:
mode:
authorqiuyiuestc <[email protected]>2010-04-12 17:37:37 +0000
committerqiuyiuestc <[email protected]>2010-04-12 17:37:37 +0000
commitcbfb87fac1020380eca3b15b32ea738820059007 (patch)
tree23522eed21d5abc36ff4ff9fcbf69806cc13e627 /src/object.c
parentadcbe9d53fbd9753a2f3037569e3d2db8876d0d8 (diff)
add module feature
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@614 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'src/object.c')
-rw-r--r--src/object.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/object.c b/src/object.c
index 7ad0540255..3843326b61 100644
--- a/src/object.c
+++ b/src/object.c
@@ -21,6 +21,10 @@
#include "kservice.h"
+#ifdef RT_USING_MODULE
+extern struct rt_module* rt_current_module;
+#endif
+
#define _OBJ_CONTAINER_LIST_INIT(c) \
{&(rt_object_container[c].object_list), &(rt_object_container[c].object_list)}
struct rt_object_information rt_object_container[RT_Object_Class_Unknown] =
@@ -249,8 +253,14 @@ rt_object_t rt_object_allocate(enum rt_object_class_type type, const char* name)
register rt_base_t temp;
struct rt_object_information* information;
+#ifdef RT_USING_MODULE
+ /* get module object information */
+ information = (rt_current_module != RT_NULL) ?
+ &rt_current_module->module_object[type] : &rt_object_container[type];
+#else
/* get object information */
information = &rt_object_container[type];
+#endif
object = (struct rt_object*)rt_malloc(information->object_size);
if (object == RT_NULL)