mirror of
https://github.com/0xFEEDC0DE64/arduino-esp32.git
synced 2025-07-27 01:07:15 +02:00
IDF release/v4.0 08219f3cf
This commit is contained in:
@ -7,8 +7,8 @@
|
||||
* of use.
|
||||
*/
|
||||
|
||||
#ifndef _COAP_MEM_H_
|
||||
#define _COAP_MEM_H_
|
||||
#ifndef COAP_MEM_H_
|
||||
#define COAP_MEM_H_
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
@ -37,7 +37,12 @@ typedef enum {
|
||||
COAP_PDU,
|
||||
COAP_PDU_BUF,
|
||||
COAP_RESOURCE,
|
||||
COAP_RESOURCEATTR
|
||||
COAP_RESOURCEATTR,
|
||||
#ifdef HAVE_LIBTINYDTLS
|
||||
COAP_DTLS_SESSION,
|
||||
#endif
|
||||
COAP_SESSION,
|
||||
COAP_OPTLIST,
|
||||
} coap_memory_tag_t;
|
||||
|
||||
#ifndef WITH_LWIP
|
||||
@ -67,14 +72,14 @@ void coap_free_type(coap_memory_tag_t type, void *p);
|
||||
/**
|
||||
* Wrapper function to coap_malloc_type() for backwards compatibility.
|
||||
*/
|
||||
static inline void *coap_malloc(size_t size) {
|
||||
COAP_STATIC_INLINE void *coap_malloc(size_t size) {
|
||||
return coap_malloc_type(COAP_STRING, size);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper function to coap_free_type() for backwards compatibility.
|
||||
*/
|
||||
static inline void coap_free(void *object) {
|
||||
COAP_STATIC_INLINE void coap_free(void *object) {
|
||||
coap_free_type(COAP_STRING, object);
|
||||
}
|
||||
|
||||
@ -86,7 +91,7 @@ static inline void coap_free(void *object) {
|
||||
|
||||
/* no initialization needed with lwip (or, more precisely: lwip must be
|
||||
* completely initialized anyway by the time coap gets active) */
|
||||
static inline void coap_memory_init(void) {}
|
||||
COAP_STATIC_INLINE void coap_memory_init(void) {}
|
||||
|
||||
/* It would be nice to check that size equals the size given at the memp
|
||||
* declaration, but i currently don't see a standard way to check that without
|
||||
@ -98,14 +103,14 @@ static inline void coap_memory_init(void) {}
|
||||
/* Those are just here to make uri.c happy where string allocation has not been
|
||||
* made conditional.
|
||||
*/
|
||||
static inline void *coap_malloc(size_t size) {
|
||||
COAP_STATIC_INLINE void *coap_malloc(size_t size) {
|
||||
LWIP_ASSERT("coap_malloc must not be used in lwIP", 0);
|
||||
}
|
||||
|
||||
static inline void coap_free(void *pointer) {
|
||||
COAP_STATIC_INLINE void coap_free(void *pointer) {
|
||||
LWIP_ASSERT("coap_free must not be used in lwIP", 0);
|
||||
}
|
||||
|
||||
#endif /* WITH_LWIP */
|
||||
|
||||
#endif /* _COAP_MEM_H_ */
|
||||
#endif /* COAP_MEM_H_ */
|
||||
|
Reference in New Issue
Block a user