mem_std.c 694 字节
Newer Older
1
/*
2
 * Copyright (c) 2006-2018, RT-Thread Development Team
3
 *
4
 * SPDX-License-Identifier: Apache-2.0
5 6 7
 *
 * Change Logs:
 * 2014-08-03     bernard      Add file header.
8
 */
9 10 11

#include "rtthread.h"

12
#ifdef RT_USING_HEAP
B
Bernard Xiong 已提交
13 14

#ifdef __CC_ARM
15
/* avoid the heap and heap-using library functions supplied by arm */
16
#pragma import(__use_no_heap)
B
Bernard Xiong 已提交
17
#endif
18

19
void *malloc(size_t n)
20 21 22
{
    return rt_malloc(n);
}
23
RTM_EXPORT(malloc);
24

25
void *realloc(void *rmem, size_t newsize)
26 27 28
{
    return rt_realloc(rmem, newsize);
}
29
RTM_EXPORT(realloc);
30

31
void *calloc(size_t nelem, size_t elsize)
32
{
B
bernard 已提交
33
    return rt_calloc(nelem, elsize);
34
}
35
RTM_EXPORT(calloc);
36

37 38 39 40
void free(void *rmem)
{
    rt_free(rmem);
}
41
RTM_EXPORT(free);
42
#endif