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