_set of a aarray will create only a copy which fits exactly in
what is needed. No need for extra space.
This commit is contained in:
1 parent
56bb67fbb1
commit
cad4d92a00
1 file changed
+1
-5
@@ -150,11 +150,7 @@
|
||||
ARRAYI_CONTRACT(s); \
|
||||
if (M_UNLIKELY (d == s)) return; \
|
||||
if (s->size > d->alloc) { \
|
||||
size_t alloc = ARRAYI_INC_ALLOC_SIZE(oplist, s->size); \
|
||||
if (M_UNLIKELY (alloc <= d->alloc)) { \
|
||||
M_MEMORY_FULL(sizeof (type) * alloc); \
|
||||
return ; \
|
||||
} \
|
||||
const size_t alloc = s->size; \
|
||||
type *ptr = M_GET_REALLOC oplist (type, d->ptr, alloc); \
|
||||
if (M_UNLIKELY (ptr == NULL)) { \
|
||||
M_MEMORY_FULL(sizeof (type) * alloc); \
|
||||
|
||||
Reference in new issue
Block a user