Commit f2d3008d authored by Paul Eggert's avatar Paul Eggert
Browse files

* alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check

in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
word size.
parent 0a20c80c
2011-04-19 Paul Eggert <eggert@cs.ucla.edu>
* alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
word size.
* gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
(gnutls_make_error): Rename local to avoid shadowing.
(gnutls_emacs_global_deinit): ifdef out; not used.
......
......@@ -1643,9 +1643,17 @@ static char const string_overrun_cookie[GC_STRING_OVERRUN_COOKIE_SIZE] =
#else /* not GC_CHECK_STRING_BYTES */
/* The 'max' reserves space for the nbytes union member even when NBYTES + 1 is
less than the size of that member. The 'max' is not needed when
SDATA_DATA_OFFSET is a multiple of sizeof (EMACS_INT), because then the
alignment code reserves enough space. */
#define SDATA_SIZE(NBYTES) \
((SDATA_DATA_OFFSET \
+ max (NBYTES, sizeof (EMACS_INT) - 1) + 1 \
+ (SDATA_DATA_OFFSET % sizeof (EMACS_INT) == 0 \
? NBYTES \
: max (NBYTES, sizeof (EMACS_INT) - 1)) \
+ 1 \
+ sizeof (EMACS_INT) - 1) \
& ~(sizeof (EMACS_INT) - 1))
......
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