1 /*
2  * Copyright (C) 2015-2018 Alibaba Group Holding Limited
3  */
4 
5 #ifndef __COAP_PLATFORM_OS_H__
6 #define __COAP_PLATFORM_OS_H__
7 #include <stdio.h>
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif /* __cplusplus */
12 
13 #ifdef INFRA_MEM_STATS
14 #include "linkkit/infra/infra_mem_stats.h"
15 #define coap_malloc(size) LITE_malloc(size, MEM_MAGIC, "coap.cloud")
16 #define coap_free(ptr)    LITE_free(ptr)
17 #else
18 #define coap_malloc(size) HAL_Malloc(size)
19 #define coap_free(ptr)         \
20     {                          \
21         HAL_Free((void *)ptr); \
22         ptr = NULL;            \
23     }
24 #endif
25 
26 #ifdef __cplusplus
27 }
28 #endif /* __cplusplus */
29 
30 #endif
31