• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>Algorithm Tuning</title>
5<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7<link rel="home" href="../../index.html" title="Boost.Regex 5.1.4">
8<link rel="up" href="../configuration.html" title="Configuration">
9<link rel="prev" href="algorithm.html" title="Algorithm Selection">
10<link rel="next" href="../install.html" title="Building and Installing the Library">
11</head>
12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13<table cellpadding="2" width="100%"><tr>
14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
15<td align="center"><a href="../../../../../../index.html">Home</a></td>
16<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
19<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
20</tr></table>
21<hr>
22<div class="spirit-nav">
23<a accesskey="p" href="algorithm.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../configuration.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../install.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
24</div>
25<div class="section">
26<div class="titlepage"><div><div><h3 class="title">
27<a name="boost_regex.configuration.tuning"></a><a class="link" href="tuning.html" title="Algorithm Tuning">Algorithm Tuning</a>
28</h3></div></div></div>
29<p>
30        The following option applies only if BOOST_REGEX_RECURSIVE is set.
31      </p>
32<div class="informaltable"><table class="table">
33<colgroup>
34<col>
35<col>
36</colgroup>
37<thead><tr>
38<th>
39                <p>
40                  macro
41                </p>
42              </th>
43<th>
44                <p>
45                  description
46                </p>
47              </th>
48</tr></thead>
49<tbody><tr>
50<td>
51                <p>
52                  BOOST_REGEX_HAS_MS_STACK_GUARD
53                </p>
54              </td>
55<td>
56                <p>
57                  Tells Boost.Regex that Microsoft style __try - __except blocks
58                  are supported, and can be used to safely trap stack overflow.
59                </p>
60              </td>
61</tr></tbody>
62</table></div>
63<p>
64        The following options apply only if BOOST_REGEX_NON_RECURSIVE is set.
65      </p>
66<div class="informaltable"><table class="table">
67<colgroup>
68<col>
69<col>
70</colgroup>
71<thead><tr>
72<th>
73                <p>
74                  macro
75                </p>
76              </th>
77<th>
78                <p>
79                  description
80                </p>
81              </th>
82</tr></thead>
83<tbody>
84<tr>
85<td>
86                <p>
87                  BOOST_REGEX_BLOCKSIZE
88                </p>
89              </td>
90<td>
91                <p>
92                  In non-recursive mode, Boost.Regex uses largish blocks of memory
93                  to act as a stack for the state machine, the larger the block size
94                  then the fewer allocations that will take place. This defaults
95                  to 4096 bytes, which is large enough to match the vast majority
96                  of regular expressions without further allocations, however, you
97                  can choose smaller or larger values depending upon your platforms
98                  characteristics.
99                </p>
100              </td>
101</tr>
102<tr>
103<td>
104                <p>
105                  BOOST_REGEX_MAX_BLOCKS
106                </p>
107              </td>
108<td>
109                <p>
110                  Tells Boost.Regex how many blocks of size BOOST_REGEX_BLOCKSIZE
111                  it is permitted to use. If this value is exceeded then Boost.Regex
112                  will stop trying to find a match and throw a std::runtime_error.
113                  Defaults to 1024, don't forget to tweak this value if you alter
114                  BOOST_REGEX_BLOCKSIZE by much.
115                </p>
116              </td>
117</tr>
118<tr>
119<td>
120                <p>
121                  BOOST_REGEX_MAX_CACHE_BLOCKS
122                </p>
123              </td>
124<td>
125                <p>
126                  Tells Boost.Regex how many memory blocks to store in it's internal
127                  cache - memory blocks are taken from this cache rather than by
128                  calling ::operator new. Generally speaking this can be an order
129                  of magnitude faster than calling ::opertator new each time a memory
130                  block is required, but has the downside that Boost.Regex can end
131                  up caching a large chunk of memory (by default up to 16 blocks
132                  each of BOOST_REGEX_BLOCKSIZE size). If memory is tight then try
133                  defining this to 0 (disables all caching), or if that is too slow,
134                  then a value of 1 or 2, may be sufficient. On the other hand, on
135                  large multi-processor, multi-threaded systems, you may find that
136                  a higher value is in order.
137                </p>
138              </td>
139</tr>
140</tbody>
141</table></div>
142</div>
143<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
144<td align="left"></td>
145<td align="right"><div class="copyright-footer">Copyright © 1998-2013 John Maddock<p>
146        Distributed under the Boost Software License, Version 1.0. (See accompanying
147        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
148      </p>
149</div></td>
150</tr></table>
151<hr>
152<div class="spirit-nav">
153<a accesskey="p" href="algorithm.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../configuration.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../install.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
154</div>
155</body>
156</html>
157