summaryrefslogtreecommitdiff
path: root/src/rt/rt_stdlib.c
blob: a4d6b58039ec43e1f5ed488c17321d41f1fbcd0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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;
}