_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); \
|
ARRAYI_CONTRACT(s); \
|
||||||
if (M_UNLIKELY (d == s)) return; \
|
if (M_UNLIKELY (d == s)) return; \
|
||||||
if (s->size > d->alloc) { \
|
if (s->size > d->alloc) { \
|
||||||
size_t alloc = ARRAYI_INC_ALLOC_SIZE(oplist, s->size); \
|
const size_t alloc = s->size; \
|
||||||
if (M_UNLIKELY (alloc <= d->alloc)) { \
|
|
||||||
M_MEMORY_FULL(sizeof (type) * alloc); \
|
|
||||||
return ; \
|
|
||||||
} \
|
|
||||||
type *ptr = M_GET_REALLOC oplist (type, d->ptr, alloc); \
|
type *ptr = M_GET_REALLOC oplist (type, d->ptr, alloc); \
|
||||||
if (M_UNLIKELY (ptr == NULL)) { \
|
if (M_UNLIKELY (ptr == NULL)) { \
|
||||||
M_MEMORY_FULL(sizeof (type) * alloc); \
|
M_MEMORY_FULL(sizeof (type) * alloc); \
|
||||||
|
|||||||
Reference in new issue
Block a user