mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user