Handle allocation failures when copying tree arrays

This commit is contained in:
Max Brunsfeld 2016-06-14 14:46:49 -07:00
parent f77c08eff5
commit 2109f0ed74
4 changed files with 22 additions and 18 deletions

View file

@ -58,15 +58,6 @@ extern "C" {
#define array_reverse(self) \
array__reverse((VoidArray *)(self), array__elem_size(self))
#define array_copy(self) \
{ \
(self)->contents \
? memcpy(ts_calloc((self)->capacity, array__elem_size(self)), \
(self)->contents, (self)->size *array__elem_size(self)) \
: NULL, \
(self)->size, (self)->capacity, \
}
// Private
typedef Array(void) VoidArray;