summaryrefslogtreecommitdiff
path: root/common/rt/src/rt_stdlib.cpp
diff options
context:
space:
mode:
authorfengweihao <[email protected]>2019-11-05 11:38:40 +0800
committerfengweihao <[email protected]>2019-11-05 11:38:40 +0800
commit7192f437e55c9141d8cc72858295d4c5c6556616 (patch)
tree95dbf9e93da30601c34af4279ac9380251ae3d86 /common/rt/src/rt_stdlib.cpp
parent8b089533e9c75bc6a99917cce71bc3839dd0ab44 (diff)
* 修改编译方式为CMakev2.1.2-20191105
* 删除C++适配代码 * 修改编译告警
Diffstat (limited to 'common/rt/src/rt_stdlib.cpp')
-rw-r--r--common/rt/src/rt_stdlib.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/common/rt/src/rt_stdlib.cpp b/common/rt/src/rt_stdlib.cpp
new file mode 100644
index 0000000..a4d6b58
--- /dev/null
+++ b/common/rt/src/rt_stdlib.cpp
@@ -0,0 +1,29 @@
+
+#include <stdlib.h>
+#include <string.h>
+#include "rt_common.h"
+#include "rt_stdlib.h"
+
+void *kmalloc(int s,
+ int flags,
+ int __attribute__((__unused__)) node)
+{
+ void *p;
+
+ if(likely((p = malloc(s)) != NULL)){
+ if(flags & MPF_CLR)
+ memset(p, 0, s);
+ }
+
+ return p;
+}
+
+void kfree(void *p)
+{
+ if(likely(p != NULL)){
+ free(p);
+ }
+
+ p = NULL;
+}
+