From 4ebfdd3679ae46341b25f1aa3ba95480d6c514d1 Mon Sep 17 00:00:00 2001 From: ph10 Date: Fri, 27 Apr 2018 16:48:35 +0000 Subject: Re-factor pcre2_dfa_match() to use the heap instead of the stack for workspace vectors when doing recursive function calls. git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@932 6239d852-aaf2-0410-a92c-79f79f948069 --- doc/html/pcre2test.html | 58 ++++++++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 22 deletions(-) (limited to 'doc/html/pcre2test.html') diff --git a/doc/html/pcre2test.html b/doc/html/pcre2test.html index 7d98d90..d6e5345 100644 --- a/doc/html/pcre2test.html +++ b/doc/html/pcre2test.html @@ -1199,7 +1199,7 @@ pattern. get=<number or name> extract captured substring getall extract all captured substrings /g global global matching - heap_limit=<n> set a limit on heap memory + heap_limit=<n> set a limit on heap memory (Kbytes) jitstack=<n> set size of JIT stack mark show mark values match_limit=<n> set a match limit @@ -1438,20 +1438,17 @@ Finding minimum limits

If the find_limits modifier is present on a subject line, pcre2test calls the relevant matching function several times, setting different values in -the match context via pcre2_set_heap_limit(), \fBpcre2_set_match_limit(), -or pcre2_set_depth_limit() until it finds the minimum values for each -parameter that allows the match to complete without error. +the match context via pcre2_set_heap_limit(), +pcre2_set_match_limit(), or pcre2_set_depth_limit() until it finds +the minimum values for each parameter that allows the match to complete without +error. If JIT is being used, only the match limit is relevant.

-If JIT is being used, only the match limit is relevant. If DFA matching is -being used, only the depth limit is relevant. -

-

-The match_limit number is a measure of the amount of backtracking -that takes place, and learning the minimum value can be instructive. For most -simple matches, the number is quite small, but for patterns with very large -numbers of matching possibilities, it can become large very quickly with -increasing length of subject string. +When using this modifier, the pattern should not contain any limit settings +such as (*LIMIT_MATCH=...) within it. If such a setting is present and is +lower than the minimum matching value, the minimum value cannot be found +because pcre2_set_match_limit() etc. are only able to reduce the value of +an in-pattern limit; they cannot increase it.

For non-DFA matching, the minimum depth_limit number is a measure of how @@ -1460,6 +1457,22 @@ searched). In the case of DFA matching, depth_limit controls the depth of recursive calls of the internal function that is used for handling pattern recursion, lookaround assertions, and atomic groups.

+

+For non-DFA matching, the match_limit number is a measure of the amount +of backtracking that takes place, and learning the minimum value can be +instructive. For most simple matches, the number is quite small, but for +patterns with very large numbers of matching possibilities, it can become large +very quickly with increasing length of subject string. In the case of DFA +matching, match_limit controls the total number of calls, both recursive +and non-recursive, to the internal matching function, thus controlling the +overall amount of computing resource that is used. +

+

+For both kinds of matching, the heap_limit number (which is in kilobytes) +limits the amount of heap memory used for matching. A value of zero disables +the use of any heap memory; many simple pattern matches can be done without +using the heap, so this is not an unreasonable setting. +


Showing MARK names
@@ -1476,13 +1489,14 @@ Showing memory usage

The memory modifier causes pcre2test to log the sizes of all heap memory allocation and freeing calls that occur during a call to -pcre2_match(). These occur only when a match requires a bigger vector -than the default for remembering backtracking points. In many cases there will -be no heap memory used and therefore no additional output. No heap memory is -allocated during matching with pcre2_dfa_match or with JIT, so in those -cases the memory modifier never has any effect. For this modifier to -work, the null_context modifier must not be set on both the pattern and -the subject, though it can be set on one or the other. +pcre2_match() or pcre2_dfa_match(). These occur only when a match +requires a bigger vector than the default for remembering backtracking points +(pcre2_match()) or for internal workspace (pcre2_dfa_match()). In +many cases there will be no heap memory used and therefore no additional +output. No heap memory is allocated during matching with JIT, so in that case +the memory modifier never has any effect. For this modifier to work, the +null_context modifier must not be set on both the pattern and the +subject, though it can be set on one or the other.


Setting a starting offset @@ -1982,9 +1996,9 @@ Cambridge, England.


REVISION

-Last updated: 21 December 2017 +Last updated: 25 April 2018
-Copyright © 1997-2017 University of Cambridge. +Copyright © 1997-2018 University of Cambridge.

Return to the PCRE2 index page. -- cgit v1.2.1