/[pcre]/code/trunk/doc/pcrestack.3
ViewVC logotype

Diff of /code/trunk/doc/pcrestack.3

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 861 by ph10, Tue Jan 10 14:54:28 2012 UTC revision 901 by ph10, Sat Jan 21 15:47:59 2012 UTC
# Line 123  in the Line 123  in the
123  documentation.  documentation.
124  .P  .P
125  As a very rough rule of thumb, you should reckon on about 500 bytes per  As a very rough rule of thumb, you should reckon on about 500 bytes per
126  recursion. Thus, if you want to limit your stack usage to 8Mb, you  recursion. Thus, if you want to limit your stack usage to 8Mb, you should set
127  should set the limit at 16000 recursions. A 64Mb stack, on the other hand, can  the limit at 16000 recursions. A 64Mb stack, on the other hand, can support
128  support around 128000 recursions.  around 128000 recursions.
129  .P  .P
130  In Unix-like environments, the \fBpcretest\fP test program has a command line  In Unix-like environments, the \fBpcretest\fP test program has a command line
131  option (\fB-S\fP) that can be used to increase the size of its stack. As long  option (\fB-S\fP) that can be used to increase the size of its stack. As long
# Line 135  string. This is done by calling \fBpcre[ Line 135  string. This is done by calling \fBpcre[
135  limits.  limits.
136  .  .
137  .  .
138    .SS "Obtaining an estimate of stack usage"
139    .rs
140    .sp
141    The actual amount of stack used per recursion can vary quite a lot, depending
142    on the compiler that was used to build PCRE and the optimization or debugging
143    options that were set for it. The rule of thumb value of 500 bytes mentioned
144    above may be larger or smaller than what is actually needed. A better
145    approximation can be obtained by running this command:
146    .sp
147      pcretest -m -C
148    .sp
149    The \fB-C\fP option causes \fBpcretest\fP to output information about the
150    options with which PCRE was compiled. When \fB-m\fP is also given (before
151    \fB-C\fP), information about stack use is given in a line like this:
152    .sp
153      Match recursion uses stack: approximate frame size = 640 bytes
154    .sp
155    The value is approximate because some recursions need a bit more (up to perhaps
156    16 more bytes).
157    .P
158    If the above command is given when PCRE is compiled to use the heap instead of
159    the stack for recursion, the value that is output is the size of each block
160    that is obtained from the heap.
161    .
162    .
163  .SS "Changing stack size in Unix-like systems"  .SS "Changing stack size in Unix-like systems"
164  .rs  .rs
165  .sp  .sp
# Line 185  Cambridge CB2 3QH, England. Line 210  Cambridge CB2 3QH, England.
210  .rs  .rs
211  .sp  .sp
212  .nf  .nf
213  Last updated: 10 January 2012  Last updated: 21 January 2012
214  Copyright (c) 1997-2012 University of Cambridge.  Copyright (c) 1997-2012 University of Cambridge.
215  .fi  .fi

Legend:
Removed from v.861  
changed lines
  Added in v.901

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12