Make more array/list functions exception aware

This commit is contained in:
Patrick Pelissier committed 2024-04-11 00:55:47 +02:00
1 parent be4ff6f94d
commit c245285123
2 files changed
+10 -5

No files matched your search

+5 -2
View File
@@ -627,8 +627,11 @@
v->alloc = alloc; \
} \
memmove(&v->ptr[i+num], &v->ptr[i], sizeof(type)*(v->size - i) ); \
for(size_t k = i ; k < i+num; k++) \
M_CALL_INIT(oplist, v->ptr[k]); \
m_volatile size_t k; \
M_ON_EXCEPTION(memmove(&v->ptr[k], &v->ptr[i+num], sizeof(type)*(v->size - i) ), v->size += (k-i) ) { \
for(k = i ; k < i+num; k++) \
M_CALL_INIT(oplist, v->ptr[k]); \
} \
v->size = size; \
M_ARRA4_CONTRACT(v); \
} \
+5 -3
View File
@@ -502,7 +502,8 @@
M_MEMORY_FULL(sizeof (struct M_F(name, _s))); \
return; \
} \
M_CALL_INIT_SET(oplist, next->data, x); \
M_ON_EXCEPTION( M_C3(m_l1st_,name,_del)(next)) \
M_CALL_INIT_SET(oplist, next->data, x); \
struct M_F(name, _s) *current = insertion_point->current; \
if (M_UNLIKELY (current == NULL)) { \
next->next = *list; \
@@ -1314,12 +1315,13 @@
{ \
M_L1ST_DUAL_PUSH_CONTRACT(list); \
M_ASSERT (insertion_point != NULL); \
struct M_F(name, _s) *next = M_C3(m_l1st_,name,_new)(); \
struct M_F(name, _s) *m_volatile next = M_C3(m_l1st_,name,_new)(); \
if (M_UNLIKELY_NOMEM (next == NULL)) { \
M_MEMORY_FULL(sizeof (struct M_F(name, _s))); \
return; \
} \
M_CALL_INIT_SET(oplist, next->data, x); \
M_ON_EXCEPTION( M_C3(m_l1st_,name,_del)(next)) \
M_CALL_INIT_SET(oplist, next->data, x); \
if (M_UNLIKELY (insertion_point->current == NULL)) { \
next->next = list->back; \
list->back = next; \