Add new function _clear_ptr

This commit is contained in:
Patrick Pelissier committed 2020-07-02 10:39:05 +02:00
1 parent 6743cb9456
commit dfd12107de
1 file changed
+10 -2
+10 -2
View File
@@ -69,7 +69,7 @@ M_BEGIN_PROTECTED_CODE
// Define the oplist
#define ISHAREDI_PTR_OPLIST_P3(name, oplist) ( \
INIT(M_INIT_DEFAULT), \
INIT_SET(M_C(name, _init_set2) M_IPTR), \
INIT_SET(API_4(M_C(name, _init_set))), \
SET(M_C(name, _set) M_IPTR), \
CLEAR(M_C(name, _clear)), \
CLEAN(M_C(name, _clean) M_IPTR), \
@@ -117,7 +117,7 @@ M_BEGIN_PROTECTED_CODE
return shared; \
} \
\
static inline void \
static inline void M_ATTR_DEPRECATED \
M_C(name, _init_set2)(M_C(name,_t) *ptr, M_C(name,_t) shared) \
{ \
assert (ptr != NULL); \
@@ -154,6 +154,14 @@ M_BEGIN_PROTECTED_CODE
} \
\
static inline void \
M_C(name, _clear_ptr)(M_C(name,_t) *shared) \
{ \
assert(shared != NULL); \
M_C(name, _clear)(*shared); \
*shared = NULL; \
} \
\
static inline void \
M_C(name, _clean)(M_C(name,_t) *shared) \
{ \
M_C(name, _clear)(*shared); \