commit - 94b80cfa87e0bfc8933b9e7614974209e87de290
commit + eb4adfd9ef8f9c4e46c77c5178fd19ad1b914544
blob - 112da0c2e234000d38b2dea5c3b1112fa045b7a0
blob + 8b503d2f97ddd5ce74010697dc9c40b1e8a4b7af
--- lib/arraylist.h
+++ lib/arraylist.h
(ARRAY_LIST).p = recallocarray((ARRAY_LIST).head, \
(ARRAY_LIST).len, \
(ARRAY_LIST).allocated + \
- ((ARRAY_LIST).alloc_blocksize ? : 8), \
+ ((ARRAY_LIST).allocated ? \
+ (ARRAY_LIST).allocated / 2 : \
+ (ARRAY_LIST).alloc_blocksize ? : 8), \
sizeof(*(ARRAY_LIST).head)); \
if ((ARRAY_LIST).p == NULL) { \
NEW_ITEM_P = NULL; \
break; \
} \
(ARRAY_LIST).allocated += \
- (ARRAY_LIST).alloc_blocksize ? : 8; \
+ (ARRAY_LIST).allocated ? \
+ (ARRAY_LIST).allocated / 2 : \
+ (ARRAY_LIST).alloc_blocksize ? : 8, \
(ARRAY_LIST).head = (ARRAY_LIST).p; \
(ARRAY_LIST).p = NULL; \
}; \