From fdd7f9d19d279c794060558dfdd3fb1a59c84a49 Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Thu, 23 Mar 2017 21:39:44 +0100 Subject: [PATCH] Rewrite the computation of the size of the array to be more flexible. --- m-array.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/m-array.h b/m-array.h index 4461008f..1c57560d 100644 --- a/m-array.h +++ b/m-array.h @@ -84,7 +84,8 @@ ) // Compute alloc from the requested size. -#define ARRAYI_INC_ALLOC_SIZE(n) ((n) < 8 ? 16 : (n) * 2) +#define ARRAYI_EXPECTED_SIZE 8 +#define ARRAYI_INC_ALLOC_SIZE(n) (M_MAX(ARRAYI_EXPECTED_SIZE, (n))*2) // Internal definition. #define ARRAYI_DEF2(name, type, oplist) \