struct cset_converter input_cset;
struct _cpp_strbuf to;
unsigned char *buffer;
- size_t pad;
+ size_t pad = CPP_BUFFER_PADDING;
input_cset = init_iconv_desc (pfile, SOURCE_CHARSET, input_charset);
if (input_cset.func == convert_no_conversion)
}
}
-#ifdef HAVE_SSSE3
- pad = 64;
-#else
- pad = 16;
-#endif
/* Resize buffer if we allocated substantially too much, or if we
don't have enough space for the following padding, which allows
search_line_fast to use (possibly misaligned) vector loads. */
the majority of C source files. */
size = 8 * 1024;
-#ifdef HAVE_SSSE3
- pad = 64;
-#else
- pad = 16;
-#endif
+ pad = CPP_BUFFER_PADDING;
/* The '+ PAD' here is space for the final '\n' and PAD-1 bytes of padding,
allowing search_line_fast to use (possibly misaligned) vector loads. */
buf = XNEWVEC (uchar, size + pad);
unsigned int type;
};
+/* Tail padding required by search_line_fast alternatives. */
+#ifdef HAVE_SSSE3
+#define CPP_BUFFER_PADDING 64
+#else
+#define CPP_BUFFER_PADDING 16
+#endif
+
/* Represents the contents of a file cpplib has read in. */
struct cpp_buffer
{
"host character encoding is ASCII");
v16qi d1, d2, t1, t2;
- /* Unaligned loads. Reading beyond the final newline is safe,
- since files.cc:read_file_guts pads the allocation. */
+ /* Unaligned loads, potentially using padding after the final newline. */
+ static_assert (CPP_BUFFER_PADDING >= 64, "");
d1 = *(const v16qi_u *)s;
d2 = *(const v16qi_u *)(s + 16);
unsigned m1, m2, found;