From 125c0f99fb8b0dadf27efab02c0ab5ef92d9935e Mon Sep 17 00:00:00 2001 From: John Maddock Date: Sun, 6 Apr 2003 10:43:01 +0000 Subject: [PATCH] Finally fixed non-recursive algorithm - should now be fully usable, and is now emabled by default on non-win32 platforms. Fixed a couple of buglets in the regex comparison benchmarks. [SVN r18191] --- include/boost/regex/config.hpp | 6 ------ include/boost/regex/v4/mem_block_cache.hpp | 1 + performance/regex_comparison.hpp | 7 ++++--- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/include/boost/regex/config.hpp b/include/boost/regex/config.hpp index eed09caa..8817ef2c 100644 --- a/include/boost/regex/config.hpp +++ b/include/boost/regex/config.hpp @@ -438,12 +438,6 @@ void raise_error(const traits& t, unsigned code) * ****************************************************************************/ -#ifndef BOOST_REGEX_NON_RECURSIVE -// non-recursive mode is currently too fragile to -// auto-select, this will be removed before release: -# define BOOST_REGEX_RECURSIVE -#endif - #if !defined(BOOST_REGEX_RECURSIVE) && !defined(BOOST_REGEX_NON_RECURSIVE) # ifdef BOOST_REGEX_HAS_MS_STACK_GUARD # define BOOST_REGEX_RECURSIVE diff --git a/include/boost/regex/v4/mem_block_cache.hpp b/include/boost/regex/v4/mem_block_cache.hpp index a2ca3078..75e1928e 100644 --- a/include/boost/regex/v4/mem_block_cache.hpp +++ b/include/boost/regex/v4/mem_block_cache.hpp @@ -80,6 +80,7 @@ struct mem_block_cache mem_block_node* old = static_cast(p); old->next = next; next = old; + ++cached_blocks; } } }; diff --git a/performance/regex_comparison.hpp b/performance/regex_comparison.hpp index 9e7902cb..0a695e3b 100644 --- a/performance/regex_comparison.hpp +++ b/performance/regex_comparison.hpp @@ -57,7 +57,8 @@ struct results std::string expression; std::string description; results(const std::string& ex, const std::string& desc) - : boost_time(-1), + : boost_time(-1), + localised_boost_time(-1), greta_time(-1), safe_greta_time(-1), posix_time(-1), @@ -70,6 +71,8 @@ struct results { if((boost_time >= 0) && (boost_time < factor)) factor = boost_time; + if((localised_boost_time >= 0) && (localised_boost_time < factor)) + factor = localised_boost_time; if((greta_time >= 0) && (greta_time < factor)) factor = greta_time; if((safe_greta_time >= 0) && (safe_greta_time < factor)) @@ -78,8 +81,6 @@ struct results factor = posix_time; if((pcre_time >= 0) && (pcre_time < factor)) factor = pcre_time; - if((factor >= 0) && (factor < factor)) - factor = factor; } };