• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/router/db-4.8.30/docs/programmer_reference/
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml">
4  <head>
5    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6    <title>Release 4.0: memp_XXX</title>
7    <link rel="stylesheet" href="gettingStarted.css" type="text/css" />
8    <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
9    <link rel="start" href="index.html" title="Berkeley DB Programmer's Reference Guide" />
10    <link rel="up" href="upgrade_4_0_toc.html" title="Chapter��37.��Upgrading Berkeley DB 3.3 applications to Berkeley DB 4.0" />
11    <link rel="prev" href="upgrade_4_0_log.html" title="Release 4.0: log_XXX" />
12    <link rel="next" href="upgrade_4_0_txn.html" title="Release 4.0: txn_XXX" />
13  </head>
14  <body>
15    <div class="navheader">
16      <table width="100%" summary="Navigation header">
17        <tr>
18          <th colspan="3" align="center">Release 4.0: memp_XXX</th>
19        </tr>
20        <tr>
21          <td width="20%" align="left"><a accesskey="p" href="upgrade_4_0_log.html">Prev</a>��</td>
22          <th width="60%" align="center">Chapter��37.��Upgrading Berkeley DB 3.3 applications to Berkeley DB 4.0</th>
23          <td width="20%" align="right">��<a accesskey="n" href="upgrade_4_0_txn.html">Next</a></td>
24        </tr>
25      </table>
26      <hr />
27    </div>
28    <div class="sect1" lang="en" xml:lang="en">
29      <div class="titlepage">
30        <div>
31          <div>
32            <h2 class="title" style="clear: both"><a id="upgrade_4_0_mp"></a>Release 4.0: memp_XXX</h2>
33          </div>
34        </div>
35      </div>
36      <p>The C API for the Berkeley DB Memory Pool subsystem was reworked in the 4.0
37release as follows:</p>
38      <div class="informaltable">
39        <table border="1" width="80%">
40          <colgroup>
41            <col />
42            <col />
43          </colgroup>
44          <thead>
45            <tr>
46              <th>Historic functional interface</th>
47              <th>Berkeley DB 4.X method</th>
48            </tr>
49          </thead>
50          <tbody>
51            <tr>
52              <td>memp_register</td>
53              <td>
54                <a href="../api_reference/C/mempregister.html" class="olink">DB_ENV-&gt;memp_register()</a>
55              </td>
56            </tr>
57            <tr>
58              <td>memp_stat</td>
59              <td>
60                <a href="../api_reference/C/mempstat.html" class="olink">DB_ENV-&gt;memp_stat()</a>
61              </td>
62            </tr>
63            <tr>
64              <td>memp_sync</td>
65              <td>
66                <a href="../api_reference/C/mempsync.html" class="olink">DB_ENV-&gt;memp_sync()</a>
67              </td>
68            </tr>
69            <tr>
70              <td>memp_trickle</td>
71              <td>
72                <a href="../api_reference/C/memptrickle.html" class="olink">DB_ENV-&gt;memp_trickle()</a>
73              </td>
74            </tr>
75            <tr>
76              <td>memp_fopen</td>
77              <td>
78                <a href="../api_reference/C/mempfcreate.html" class="olink">DB_ENV-&gt;memp_fcreate()</a>
79              </td>
80            </tr>
81            <tr>
82              <td>DB_MPOOL_FINFO: ftype</td>
83              <td>
84                <a href="../api_reference/C/mempset_ftype.html" class="olink">DB_MPOOLFILE-&gt;set_ftype()</a>
85              </td>
86            </tr>
87            <tr>
88              <td>DB_MPOOL_FINFO: pgcookie</td>
89              <td>
90                <a href="../api_reference/C/mempset_pgcookie.html" class="olink">DB_MPOOLFILE-&gt;set_pgcookie()</a>
91              </td>
92            </tr>
93            <tr>
94              <td>DB_MPOOL_FINFO: fileid</td>
95              <td>
96                <a href="../api_reference/C/mempset_fileid.html" class="olink">DB_MPOOLFILE-&gt;set_fileid()</a>
97              </td>
98            </tr>
99            <tr>
100              <td>DB_MPOOL_FINFO: lsn_offset</td>
101              <td>
102                <a href="../api_reference/C/mempset_lsn_offset.html" class="olink">DB_MPOOLFILE-&gt;set_lsn_offset()</a>
103              </td>
104            </tr>
105            <tr>
106              <td>DB_MPOOL_FINFO: clear_len</td>
107              <td>
108                <a href="../api_reference/C/mempset_clear_len.html" class="olink">DB_MPOOLFILE-&gt;set_clear_len()</a>
109              </td>
110            </tr>
111            <tr>
112              <td>memp_fopen</td>
113              <td>
114                <a href="../api_reference/C/mempfopen.html" class="olink">DB_MPOOLFILE-&gt;open()</a>
115              </td>
116            </tr>
117            <tr>
118              <td>memp_fclose</td>
119              <td>
120                <a href="../api_reference/C/mempfclose.html" class="olink">DB_MPOOLFILE-&gt;close()</a>
121              </td>
122            </tr>
123            <tr>
124              <td>memp_fput</td>
125              <td>
126                <a href="../api_reference/C/mempput.html" class="olink">DB_MPOOLFILE-&gt;put()</a>
127              </td>
128            </tr>
129            <tr>
130              <td>memp_fset</td>
131              <td>DB_MPOOLFILE-&gt;set</td>
132            </tr>
133            <tr>
134              <td>memp_fsync</td>
135              <td>
136                <a href="../api_reference/C/mempfsync.html" class="olink">DB_MPOOLFILE-&gt;sync()</a>
137              </td>
138            </tr>
139          </tbody>
140        </table>
141      </div>
142      <p>Applications calling any of the memp_register, memp_stat, memp_sync or
143memp_trickle functions should update those calls to use the enclosing
144<a href="../api_reference/C/env.html" class="olink">DB_ENV class</a> handle's method (easily done as the first argument to the
145existing call is the correct <a href="../api_reference/C/env.html" class="olink">DB_ENV class</a> handle).</p>
146      <p>In addition, the <a href="../api_reference/C/mempstat.html" class="olink">DB_ENV-&gt;memp_stat()</a> call has been changed in the 4.0
147release to take a flags argument.  To leave their historic behavior
148unchanged, applications should add a final argument of 0 to any calls
149made to <a href="../api_reference/C/mempstat.html" class="olink">DB_ENV-&gt;memp_stat()</a>.</p>
150      <p>Applications calling the memp_fopen function should update those calls
151as follows: First, acquire a <a href="../api_reference/C/memp.html" class="olink">Cache chapter</a> handle using the
152<a href="../api_reference/C/mempfcreate.html" class="olink">DB_ENV-&gt;memp_fcreate()</a> method.  Second, if the DB_MPOOL_FINFO structure
153reference passed to the memp_fopen function was non-NULL, call the
154<a href="../api_reference/C/memp.html" class="olink">Cache chapter</a> method corresponding to each initialized field in
155the DB_MPOOL_FINFO structure.  Third, call the <a href="../api_reference/C/mempfopen.html" class="olink">DB_MPOOLFILE-&gt;open()</a> method
156method to open the underlying file.  If the <a href="../api_reference/C/mempfopen.html" class="olink">DB_MPOOLFILE-&gt;open()</a> method call
157fails, then <a href="../api_reference/C/mempfclose.html" class="olink">DB_MPOOLFILE-&gt;close()</a> method must be called to destroy the allocated
158handle.</p>
159      <p>Applications calling the memp_fopen, memp_fclose, memp_fput, memp_fset,
160or memp_fsync functions should update those calls to use the enclosing
161<a href="../api_reference/C/memp.html" class="olink">Cache chapter</a> handle's method.  Again, this is easily done as the
162first argument to the existing call is the correct <a href="../api_reference/C/memp.html" class="olink">Cache chapter</a>
163handle.  With one exception, the calling conventions of the old and new
164interfaces are identical; the one exception is the <a href="../api_reference/C/mempfclose.html" class="olink">DB_MPOOLFILE-&gt;close()</a> method,
165which requires an additional flag parameter that should be set to 0.</p>
166    </div>
167    <div class="navfooter">
168      <hr />
169      <table width="100%" summary="Navigation footer">
170        <tr>
171          <td width="40%" align="left"><a accesskey="p" href="upgrade_4_0_log.html">Prev</a>��</td>
172          <td width="20%" align="center">
173            <a accesskey="u" href="upgrade_4_0_toc.html">Up</a>
174          </td>
175          <td width="40%" align="right">��<a accesskey="n" href="upgrade_4_0_txn.html">Next</a></td>
176        </tr>
177        <tr>
178          <td width="40%" align="left" valign="top">Release 4.0: log_XXX��</td>
179          <td width="20%" align="center">
180            <a accesskey="h" href="index.html">Home</a>
181          </td>
182          <td width="40%" align="right" valign="top">��Release 4.0: txn_XXX</td>
183        </tr>
184      </table>
185    </div>
186  </body>
187</html>
188