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

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

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

revision 182 by ph10, Wed Jun 13 15:09:54 2007 UTC revision 691 by ph10, Sun Sep 11 14:31:21 2011 UTC
# Line 12  If you are not using any private charact Line 12  If you are not using any private charact
12  \fBpcre_maketables()\fP  \fBpcre_maketables()\fP
13  .\"  .\"
14  documentation), this is relatively straightforward. If you are using private  documentation), this is relatively straightforward. If you are using private
15  tables, it is a little bit more complicated.  tables, it is a little bit more complicated. However, if you are using the
16    just-in-time optimization feature of \fBpcre_study()\fP, it is not possible to
17    save and reload the JIT data.
18  .P  .P
19  If you save compiled patterns to a file, you can copy them to a different host  If you save compiled patterns to a file, you can copy them to a different host
20  and run them there. This works even if the new host has the opposite endianness  and run them there. This works even if the new host has the opposite endianness
21  to the one on which the patterns were compiled. There may be a small  to the one on which the patterns were compiled. There may be a small
22  performance penalty, but it should be insignificant. However, compiling regular  performance penalty, but it should be insignificant. However, compiling regular
23  expressions with one version of PCRE for use with a different version is not  expressions with one version of PCRE for use with a different version is not
24  guaranteed to work and may cause crashes.  guaranteed to work and may cause crashes, and saving and restoring a compiled
25    pattern loses any JIT optimization data.
26  .  .
27  .  .
28  .SH "SAVING A COMPILED PATTERN"  .SH "SAVING A COMPILED PATTERN"
29  .rs  .rs
30  .sh  .sp
31  The value returned by \fBpcre_compile()\fP points to a single block of memory  The value returned by \fBpcre_compile()\fP points to a single block of memory
32  that holds the compiled pattern and associated data. You can find the length of  that holds the compiled pattern and associated data. You can find the length of
33  this block in bytes by calling \fBpcre_fullinfo()\fP with an argument of  this block in bytes by calling \fBpcre_fullinfo()\fP with an argument of
# Line 58  later use. They could equally well be sa Line 61  later use. They could equally well be sa
61  some daemon process that passes them via sockets to the processes that want  some daemon process that passes them via sockets to the processes that want
62  them.  them.
63  .P  .P
64  If the pattern has been studied, it is also possible to save the study data in  If the pattern has been studied, it is also possible to save the normal study
65  a similar way to the compiled pattern itself. When studying generates  data in a similar way to the compiled pattern itself. However, if the
66  additional information, \fBpcre_study()\fP returns a pointer to a  PCRE_STUDY_JIT_COMPILE was used, the just-in-time data that is created cannot
67    be saved because it is too dependent on the current environment. When studying
68    generates additional information, \fBpcre_study()\fP returns a pointer to a
69  \fBpcre_extra\fP data block. Its format is defined in the  \fBpcre_extra\fP data block. Its format is defined in the
70  .\" HTML <a href="pcreapi.html#extradata">  .\" HTML <a href="pcreapi.html#extradata">
71  .\" </a>  .\" </a>
# Line 111  If you saved study data with the compile Line 116  If you saved study data with the compile
116  reloaded study data. You must also set the PCRE_EXTRA_STUDY_DATA bit in the  reloaded study data. You must also set the PCRE_EXTRA_STUDY_DATA bit in the
117  \fIflags\fP field to indicate that study data is present. Then pass the  \fIflags\fP field to indicate that study data is present. Then pass the
118  \fBpcre_extra\fP block to \fBpcre_exec()\fP or \fBpcre_dfa_exec()\fP in the  \fBpcre_extra\fP block to \fBpcre_exec()\fP or \fBpcre_dfa_exec()\fP in the
119  usual way.  usual way. If the pattern was studied for just-in-time optimization, that data
120    cannot be saved, and so is lost by a save/restore cycle.
121  .  .
122  .  .
123  .SH "COMPATIBILITY WITH DIFFERENT PCRE RELEASES"  .SH "COMPATIBILITY WITH DIFFERENT PCRE RELEASES"
124  .rs  .rs
125  .sp  .sp
126  In general, it is safest to recompile all saved patterns when you update to a  In general, it is safest to recompile all saved patterns when you update to a
127  new PCRE release, though not all updates actually require this. Recompiling is  new PCRE release, though not all updates actually require this.
 definitely needed for release 7.2.  
128  .  .
129  .  .
130  .  .
# Line 137  Cambridge CB2 3QH, England. Line 142  Cambridge CB2 3QH, England.
142  .rs  .rs
143  .sp  .sp
144  .nf  .nf
145  Last updated: 13 June 2007  Last updated: 26 August 2011
146  Copyright (c) 1997-2007 University of Cambridge.  Copyright (c) 1997-2011 University of Cambridge.
147  .fi  .fi

Legend:
Removed from v.182  
changed lines
  Added in v.691

  ViewVC Help
Powered by ViewVC 1.1.5