Commit fa4dd8dd authored by Paul Eggert's avatar Paul Eggert

Port VECTOR_ELTS_MAX to older GCC etc.

Problem reported by Eli Zaretskii in:
https://lists.gnu.org/r/emacs-devel/2018-12/msg00182.html
* src/alloc.c (VECTOR_ELTS_MAX): Now a macro.
Needed for portability to older GCC and non-GCC.
parent 7bcea8f8
Pipeline #231 failed with stage
in 4 minutes and 52 seconds
...@@ -3336,10 +3336,13 @@ sweep_vectors (void) ...@@ -3336,10 +3336,13 @@ sweep_vectors (void)
} }
} }
static ptrdiff_t const VECTOR_ELTS_MAX /* Maximum number of elements in a vector. This is a macro so that it
= min (((min (PTRDIFF_MAX, SIZE_MAX) - header_size - large_vector_offset) can be used in an integer constant expression. */
/ word_size),
MOST_POSITIVE_FIXNUM); #define VECTOR_ELTS_MAX \
min (((min (PTRDIFF_MAX, SIZE_MAX) - header_size - large_vector_offset) \
/ word_size), \
MOST_POSITIVE_FIXNUM)
/* Value is a pointer to a newly allocated Lisp_Vector structure /* Value is a pointer to a newly allocated Lisp_Vector structure
with room for LEN Lisp_Objects. LEN must be positive and with room for LEN Lisp_Objects. LEN must be positive and
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment