Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Keyboard Man_俊
rt-thread
提交
4afdf44d
R
rt-thread
项目概览
Keyboard Man_俊
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4afdf44d
编写于
4月 25, 2013
作者:
B
Bernard Xiong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add RT_KERNEL_MALLOC/FREE
上级
608bf2cb
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
17 addition
and
8 deletion
+17
-8
include/rtdef.h
include/rtdef.h
+9
-0
src/idle.c
src/idle.c
+1
-1
src/ipc.c
src/ipc.c
+4
-4
src/object.c
src/object.c
+2
-2
src/thread.c
src/thread.c
+1
-1
未找到文件。
include/rtdef.h
浏览文件 @
4afdf44d
...
...
@@ -155,6 +155,15 @@ typedef rt_base_t rt_off_t; /**< Type for offset */
#define RT_MM_PAGE_MASK (RT_MM_PAGE_SIZE - 1)
#define RT_MM_PAGE_BITS 12
/* kernel malloc definitions */
#ifndef RT_KERNEL_MALLOC
#define RT_KERNEL_MALLOC(sz) rt_malloc(sz)
#endif
#ifndef RT_KERNEL_FREE
#define RT_KERNEL_FREE(ptr) rt_free(ptr)
#endif
/**
* @addtogroup Error
*/
...
...
src/idle.c
浏览文件 @
4afdf44d
...
...
@@ -128,7 +128,7 @@ void rt_thread_idle_excute(void)
else
#endif
/* release thread's stack */
rt_free
(
thread
->
stack_addr
);
RT_KERNEL_FREE
(
thread
->
stack_addr
);
/* delete thread object */
rt_object_delete
((
rt_object_t
)
thread
);
#endif
...
...
src/ipc.c
浏览文件 @
4afdf44d
...
...
@@ -1314,7 +1314,7 @@ rt_mailbox_t rt_mb_create(const char *name, rt_size_t size, rt_uint8_t flag)
/* init mailbox */
mb
->
size
=
size
;
mb
->
msg_pool
=
rt_malloc
(
mb
->
size
*
sizeof
(
rt_uint32_t
));
mb
->
msg_pool
=
RT_KERNEL_MALLOC
(
mb
->
size
*
sizeof
(
rt_uint32_t
));
if
(
mb
->
msg_pool
==
RT_NULL
)
{
/* delete mailbox object */
...
...
@@ -1361,7 +1361,7 @@ rt_err_t rt_mb_delete(rt_mailbox_t mb)
#endif
/* free mailbox pool */
rt_free
(
mb
->
msg_pool
);
RT_KERNEL_FREE
(
mb
->
msg_pool
);
/* delete mailbox object */
rt_object_delete
(
&
(
mb
->
parent
.
parent
));
...
...
@@ -1827,7 +1827,7 @@ rt_mq_t rt_mq_create(const char *name,
mq
->
max_msgs
=
max_msgs
;
/* allocate message pool */
mq
->
msg_pool
=
rt_malloc
((
mq
->
msg_size
+
sizeof
(
struct
rt_mq_message
))
*
mq
->
max_msgs
);
mq
->
msg_pool
=
RT_KERNEL_MALLOC
((
mq
->
msg_size
+
sizeof
(
struct
rt_mq_message
))
*
mq
->
max_msgs
);
if
(
mq
->
msg_pool
==
RT_NULL
)
{
rt_mq_delete
(
mq
);
...
...
@@ -1881,7 +1881,7 @@ rt_err_t rt_mq_delete(rt_mq_t mq)
#endif
/* free message queue pool */
rt_free
(
mq
->
msg_pool
);
RT_KERNEL_FREE
(
mq
->
msg_pool
);
/* delete message queue object */
rt_object_delete
(
&
(
mq
->
parent
.
parent
));
...
...
src/object.c
浏览文件 @
4afdf44d
...
...
@@ -281,7 +281,7 @@ rt_object_t rt_object_allocate(enum rt_object_class_type type, const char *name)
information
=
&
rt_object_container
[
type
];
#endif
object
=
(
struct
rt_object
*
)
rt_malloc
(
information
->
object_size
);
object
=
(
struct
rt_object
*
)
RT_KERNEL_MALLOC
(
information
->
object_size
);
if
(
object
==
RT_NULL
)
{
/* no memory can be allocated */
...
...
@@ -353,7 +353,7 @@ void rt_object_delete(rt_object_t object)
#endif
/* free the memory of object */
rt_free
(
object
);
RT_KERNEL_FREE
(
object
);
}
#endif
...
...
src/thread.c
浏览文件 @
4afdf44d
...
...
@@ -298,7 +298,7 @@ rt_thread_t rt_thread_create(const char *name,
if
(
thread
==
RT_NULL
)
return
RT_NULL
;
stack_start
=
(
void
*
)
rt_malloc
(
stack_size
);
stack_start
=
(
void
*
)
RT_KERNEL_MALLOC
(
stack_size
);
if
(
stack_start
==
RT_NULL
)
{
/* allocate stack failure */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录