array.c: set array size limitation again

Unlike strings, arrays occupies more memory. It is still arguable
whether the current limit (131072) is appropriate.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2023-10-12 23:01:08 +09:00
parent 1321e33f08
commit 4c696ed9e3
-4
View File
@@ -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