/[pcre]/code/trunk/doc/html/pcrejit.html
ViewVC logotype

Diff of /code/trunk/doc/html/pcrejit.html

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

revision 787 by ph10, Mon Dec 5 12:33:44 2011 UTC revision 788 by ph10, Tue Dec 6 15:38:01 2011 UTC
# Line 68  way that falls back to the ordinary PCRE Line 68  way that falls back to the ordinary PCRE
68  If your program may sometimes be linked with versions of PCRE that are older  If your program may sometimes be linked with versions of PCRE that are older
69  than 8.20, but you want to use JIT when it is available, you can test  than 8.20, but you want to use JIT when it is available, you can test
70  the values of PCRE_MAJOR and PCRE_MINOR, or the existence of a JIT macro such  the values of PCRE_MAJOR and PCRE_MINOR, or the existence of a JIT macro such
71  as PCRE_CONFIG_JIT, for compile-time control of your code.  as PCRE_CONFIG_JIT, for compile-time control of your code.
72  </P>  </P>
73  <br><a name="SEC3" href="#TOC1">SIMPLE USE OF JIT</a><br>  <br><a name="SEC3" href="#TOC1">SIMPLE USE OF JIT</a><br>
74  <P>  <P>
# Line 88  For a program that may be linked with pr Line 88  For a program that may be linked with pr
88    #define PCRE_STUDY_JIT_COMPILE 0    #define PCRE_STUDY_JIT_COMPILE 0
89    #endif    #endif
90  </pre>  </pre>
91  so that no option is passed to <b>pcre_study()</b>, and then use something like  so that no option is passed to <b>pcre_study()</b>, and then use something like
92  this to free the study data:  this to free the study data:
93  <pre>  <pre>
94    #ifdef PCRE_CONFIG_JIT    #ifdef PCRE_CONFIG_JIT
# Line 188  is given when there is not enough stack. Line 188  is given when there is not enough stack.
188  managing blocks of memory for use as JIT stacks. There is further discussion  managing blocks of memory for use as JIT stacks. There is further discussion
189  about the use of JIT stacks in the section entitled  about the use of JIT stacks in the section entitled
190  <a href="#stackcontrol">"JIT stack FAQ"</a>  <a href="#stackcontrol">"JIT stack FAQ"</a>
191  below.  below.
192  </P>  </P>
193  <P>  <P>
194  The <b>pcre_jit_stack_alloc()</b> function creates a JIT stack. Its arguments  The <b>pcre_jit_stack_alloc()</b> function creates a JIT stack. Its arguments
# Line 269  Although it is possible, its updating ti Line 269  Although it is possible, its updating ti
269  we do the recursion in memory.  we do the recursion in memory.
270  </P>  </P>
271  <P>  <P>
272  (2) Why don't we simply allocate blocks of memory with <b>malloc()</b>?  (2) Why don't we simply allocate blocks of memory with <b>malloc()</b>?
273  <br>  <br>
274  <br>  <br>
275  Modern operating systems have a nice feature: they can reserve an address space  Modern operating systems have a nice feature: they can reserve an address space
# Line 280  only a single memory page (usually 4K) i Line 280  only a single memory page (usually 4K) i
280  grow up to 1M anytime if needed.  grow up to 1M anytime if needed.
281  </P>  </P>
282  <P>  <P>
283  (3) Who "owns" a JIT stack?  (3) Who "owns" a JIT stack?
284  <br>  <br>
285  <br>  <br>
286  The owner of the stack is the user program, not the JIT studied pattern or  The owner of the stack is the user program, not the JIT studied pattern or
# Line 317  list of the currently JIT studied patter Line 317  list of the currently JIT studied patter
317  <P>  <P>
318  (6) OK, the stack is for long term memory allocation. But what happens if a  (6) OK, the stack is for long term memory allocation. But what happens if a
319  pattern causes stack overflow with a stack of 1M? Is that 1M kept until the  pattern causes stack overflow with a stack of 1M? Is that 1M kept until the
320  stack is freed?  stack is freed?
321  <br>  <br>
322  <br>  <br>
323  Especially on embedded sytems, it might be a good idea to release  Especially on embedded sytems, it might be a good idea to release
# Line 328  stack) would be a good idea if someone n Line 328  stack) would be a good idea if someone n
328  </P>  </P>
329  <P>  <P>
330  (7) This is too much of a headache. Isn't there any better solution for JIT  (7) This is too much of a headache. Isn't there any better solution for JIT
331  stack handling?  stack handling?
332  <br>  <br>
333  <br>  <br>
334  No, thanks to Windows. If POSIX threads were used everywhere, we could throw  No, thanks to Windows. If POSIX threads were used everywhere, we could throw

Legend:
Removed from v.787  
changed lines
  Added in v.788

  ViewVC Help
Powered by ViewVC 1.1.5