Add _init_new for i-shared

This commit is contained in:
Patrick Pelissier committed 2017-03-17 00:29:07 +01:00
1 parent 5ff056656a
commit f004dadcee
1 file changed
+13
+13
View File
@@ -95,6 +95,19 @@
*ptr = M_C3(ishared_, name, _init_set)(shared); \
} \
\
static inline type * \
M_C3(ishared_, name, _init_new)(void) \
{ \
type *ptr = M_GET_NEW oplist (sizeof (type)); \
if (ptr == NULL) { \
M_MEMORY_FULL(sizeof(type)); \
return NULL; \
} \
M_GET_INIT oplist (*ptr); \
ptr->M_C(name, _cpt) = 1; \
return ptr; \
} \
\
static inline void \
M_C3(ishared_, name, _clear)(type *shared) \
{ \