Handle allocation failures when copying tree arrays
This commit is contained in:
parent
f77c08eff5
commit
2109f0ed74
4 changed files with 22 additions and 18 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue