/[pcre]/code/trunk/pcre_exec.c
ViewVC logotype

Diff of /code/trunk/pcre_exec.c

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

revision 164 by ph10, Fri May 4 15:11:14 2007 UTC revision 165 by ph10, Wed May 9 10:50:57 2007 UTC
# Line 189  obtained from malloc() instead instead o Line 189  obtained from malloc() instead instead o
189  achieve this so that the actual code doesn't look very different to what it  achieve this so that the actual code doesn't look very different to what it
190  always used to.  always used to.
191    
192  The original heap-recursive code used longjmp(). However, it seems that this  The original heap-recursive code used longjmp(). However, it seems that this
193  can be very slow on some operating systems. Following a suggestion from Stan  can be very slow on some operating systems. Following a suggestion from Stan
194  Switzer, the use of longjmp() has been abolished, at the cost of having to  Switzer, the use of longjmp() has been abolished, at the cost of having to
195  provide a unique number for each call to RMATCH. There is no way of generating  provide a unique number for each call to RMATCH. There is no way of generating
# Line 198  them stand out more clearly. Line 198  them stand out more clearly.
198    
199  Crude tests on x86 Linux show a small speedup of around 5-8%. However, on  Crude tests on x86 Linux show a small speedup of around 5-8%. However, on
200  FreeBSD, avoiding longjmp() more than halves the time taken to run the standard  FreeBSD, avoiding longjmp() more than halves the time taken to run the standard
201  tests. Furthermore, not using longjmp() means that local dynamic variables  tests. Furthermore, not using longjmp() means that local dynamic variables
202  don't have indeterminate values; this has meant that the frame size can be  don't have indeterminate values; this has meant that the frame size can be
203  reduced because the result can be "passed back" by straight setting of the  reduced because the result can be "passed back" by straight setting of the
204  variable instead of being passed in the frame.  variable instead of being passed in the frame.
205  ****************************************************************************  ****************************************************************************
# Line 213  enum { RM1=1, RM2, RM3, RM4, RM5, RM Line 213  enum { RM1=1, RM2, RM3, RM4, RM5, RM
213         RM21,  RM22, RM23, RM24, RM25, RM26, RM27, RM28, RM29, RM30,         RM21,  RM22, RM23, RM24, RM25, RM26, RM27, RM28, RM29, RM30,
214         RM31,  RM32, RM33, RM34, RM35, RM36, RM37, RM38, RM39, RM40,         RM31,  RM32, RM33, RM34, RM35, RM36, RM37, RM38, RM39, RM40,
215         RM41,  RM42, RM43, RM44, RM45, RM46, RM47 };         RM41,  RM42, RM43, RM44, RM45, RM46, RM47 };
216    
217    
218  /* These versions of the macros use the stack, as normal. There are debugging  /* These versions of the macros use the stack, as normal. There are debugging
219  versions and production versions. Note that the "rw" argument of RMATCH isn't  versions and production versions. Note that the "rw" argument of RMATCH isn't
220  actuall used in this definition. */  actuall used in this definition. */
221    
222  #ifndef NO_RECURSE  #ifndef NO_RECURSE
# Line 344  typedef struct heapframe { Line 344  typedef struct heapframe {
344    /* Where to jump back to */    /* Where to jump back to */
345    
346    int Xwhere;    int Xwhere;
347    
348  } heapframe;  } heapframe;
349    
350  #endif  #endif
# Line 3651  for (;;) Line 3651  for (;;)
3651  /* Control never reaches here */  /* Control never reaches here */
3652    
3653    
3654  /* When compiling to use the heap rather than the stack for recursive calls to  /* When compiling to use the heap rather than the stack for recursive calls to
3655  match(), the RRETURN() macro jumps here. The number that is saved in  match(), the RRETURN() macro jumps here. The number that is saved in
3656  frame->Xwhere indicates which label we actually want to return to. */  frame->Xwhere indicates which label we actually want to return to. */
3657    
3658  #ifdef NO_RECURSE  #ifdef NO_RECURSE
# Line 3670  switch (frame->Xwhere) Line 3670  switch (frame->Xwhere)
3670    DPRINTF(("jump error in pcre match: label %d non-existent\n", frame->Xwhere));    DPRINTF(("jump error in pcre match: label %d non-existent\n", frame->Xwhere));
3671    return PCRE_ERROR_INTERNAL;    return PCRE_ERROR_INTERNAL;
3672    }    }
3673  #undef LBL  #undef LBL
3674  #endif  /* NO_RECURSE */  #endif  /* NO_RECURSE */
3675  }  }
3676    

Legend:
Removed from v.164  
changed lines
  Added in v.165

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12