Remove limit on the number of backrefs possible.

Changes named sub-expressions to use different hashing scheme: high order bit is now always set to clashes between hashes and indexes don't happen until 2^30 or 2^62 sub-expressions in 32 and 64 bit code respectively.
Changes bitmask of seen sub-expressions to use dynamic storage for sub-expression indexes above 64.
Adds tests for the above.
Fixes https://github.com/boostorg/regex/issues/75.
This commit is contained in:
jzmaddock
2020-01-19 11:28:36 +00:00
parent b5d60694cc
commit 4bb4d392e4
7 changed files with 81 additions and 20 deletions

View File

@ -139,10 +139,10 @@ int cpp_main(int /*argc*/, char * /*argv*/[])
int* get_array_data()
{
static boost::thread_specific_ptr<boost::array<int, 200> > tp;
static boost::thread_specific_ptr<boost::array<int, 800> > tp;
if(tp.get() == 0)
tp.reset(new boost::array<int, 200>);
tp.reset(new boost::array<int, 800>);
return tp.get()->data();
}
@ -160,9 +160,9 @@ const int* make_array(int first, ...)
#ifdef TEST_THREADS
int* data = get_array_data();
#else
static int data[200];
static int data[800];
#endif
std::fill_n(data, 200, -2);
std::fill_n(data, 800, -2);
va_list ap;
va_start(ap, first);
//