summaryrefslogtreecommitdiff
path: root/src/mem.c
diff options
context:
space:
mode:
author[email protected] <[email protected]>2011-06-15 00:12:40 +0000
committer[email protected] <[email protected]>2011-06-15 00:12:40 +0000
commitde50381baabcc4280c27331e3988eeccb688f6e5 (patch)
treed1d1f507f4edebf7f990498e402e79f018bd0703 /src/mem.c
parentee68988518f8aa2b7cdafc2bcfe0abe6ad7df385 (diff)
because the sethook operation is invoked only in system initialization, the interrupt protect is removed.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1504 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'src/mem.c')
-rw-r--r--src/mem.c17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/mem.c b/src/mem.c
index 81f1362dbb..4447c69514 100644
--- a/src/mem.c
+++ b/src/mem.c
@@ -49,6 +49,7 @@
*
*/
+#include <rthw.h>
#include <rtthread.h>
/* #define RT_MEM_DEBUG */
@@ -72,15 +73,7 @@ static void (*rt_free_hook)(void *ptr);
*/
void rt_malloc_sethook(void (*hook)(void *ptr, rt_size_t size))
{
- register rt_base_t temp;
-
- /* disable interrupt */
- temp = rt_hw_interrupt_disable();
-
rt_malloc_hook = hook;
-
- /* enable interrupt */
- rt_hw_interrupt_enable(temp);
}
/**
@@ -91,15 +84,7 @@ void rt_malloc_sethook(void (*hook)(void *ptr, rt_size_t size))
*/
void rt_free_sethook(void (*hook)(void *ptr))
{
- register rt_base_t temp;
-
- /* disable interrupt */
- temp = rt_hw_interrupt_disable();
-
rt_free_hook = hook;
-
- /* enable interrupt */
- rt_hw_interrupt_enable(temp);
}
/*@}*/