{
size_t i;
- align &= 63;
+ align &= (getpagesize () / sizeof (CHAR)) - 1;
if (align + sizeof (CHAR) * len >= page_size)
return;
do_test (sizeof (CHAR) * i, (size_t)((1 << i) / 1.5));
}
+ /* Test strings near page boundary */
+
+ size_t maxlength = 64 / sizeof (CHAR) - 1;
+ size_t pagesize = getpagesize () / sizeof (CHAR);
+
+ for (i = maxlength ; i > 1; --i)
+ {
+ /* String stays on the same page. */
+ do_test (pagesize - i, i - 1);
+ /* String crosses page boundary. */
+ do_test (pagesize - i, maxlength);
+ }
+
do_random_tests ();
return ret;
}