diff options
Diffstat (limited to 'common/rt/src/rt_stdlib.cpp')
| -rw-r--r-- | common/rt/src/rt_stdlib.cpp | 29 |
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; +} + |
