From 4c696ed9e38fdda584b6d24848338f938b13a893 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Thu, 12 Oct 2023 23:01:08 +0900 Subject: [PATCH] array.c: set array size limitation again Unlike strings, arrays occupies more memory. It is still arguable whether the current limit (131072) is appropriate. --- src/array.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/array.c b/src/array.c index c83008cbb..a4d6cece2 100644 --- a/src/array.c +++ b/src/array.c @@ -18,12 +18,8 @@ #define ARY_SHRINK_RATIO 5 /* must be larger than 2 */ #define ARY_C_MAX_SIZE (SIZE_MAX / sizeof(mrb_value)) #ifndef MRB_ARY_LENGTH_MAX -#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) -#define MRB_ARY_LENGTH_MAX 0 -#else #define MRB_ARY_LENGTH_MAX 131072 #endif -#endif #define ARY_MAX_SIZE ((mrb_int)((ARY_C_MAX_SIZE < (size_t)MRB_INT_MAX) ? ARY_C_MAX_SIZE : MRB_INT_MAX-1)) static void