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 3.3: DB->set_malloc, DB->set_realloc</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_3_3_toc.html" title="Chapter��36.��Upgrading Berkeley DB 3.2 applications to Berkeley DB 3.3" /> 11 <link rel="prev" href="upgrade_3_3_getswap.html" title="Release 3.3: DB->get_byteswapped" /> 12 <link rel="next" href="upgrade_3_3_conflict.html" title="Release 3.3: DB_LOCK_CONFLICT" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">Release 3.3: DB->set_malloc, DB->set_realloc</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="upgrade_3_3_getswap.html">Prev</a>��</td> 22 <th width="60%" align="center">Chapter��36.��Upgrading Berkeley DB 3.2 applications to Berkeley DB 3.3</th> 23 <td width="20%" align="right">��<a accesskey="n" href="upgrade_3_3_conflict.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_3_3_alloc"></a>Release 3.3: DB->set_malloc, DB->set_realloc</h2> 33 </div> 34 </div> 35 </div> 36 <p>There are two new methods in the Berkeley DB 3.3 release: 37<a href="../api_reference/C/envset_alloc.html" class="olink">DB_ENV->set_alloc()</a>. These functions 38allow applications to specify a set of allocation functions for the 39Berkeley DB library to use when allocating memory to be owned by the 40application and when freeing memory that was originally allocated by the 41application.</p> 42 <p>The new methods affect or replace the following historic methods:</p> 43 <div class="variablelist"> 44 <dl> 45 <dt> 46 <span class="term">DB->set_malloc</span> 47 </dt> 48 <dd>The DB->set_malloc method has been replaced in its entirety. 49Applications using this method should replace the call with a call 50to <a href="../api_reference/C/dbset_alloc.html" class="olink">DB->set_alloc()</a>.</dd> 51 <dt> 52 <span class="term">DB->set_realloc</span> 53 </dt> 54 <dd>The DB->set_realloc method has been replaced in its entirety. 55Applications using this method should replace the call with a call 56to <a href="../api_reference/C/dbset_alloc.html" class="olink">DB->set_alloc()</a>.</dd> 57 <dt> 58 <span class="term"><a href="../api_reference/C/dbstat.html" class="olink">DB->stat()</a> method</span> 59 </dt> 60 <dd> has 61been replaced. Applications using this method should do as follows: 62if the argument is NULL, it should simply be removed. If non-NULL, 63it should be replaced with a call to <a href="../api_reference/C/dbset_alloc.html" class="olink">DB->set_alloc()</a>.</dd> 64 <dt> 65 <span class="term">lock_stat</span> 66 </dt> 67 <dd>The historic <span class="bold"><strong>db_malloc</strong></span> argument to the lock_stat function has 68been replaced. Applications using this function should do as follows: 69if the argument is NULL, it should simply be removed. If 70non-NULL, it should be replaced with a call to <a href="../api_reference/C/envset_alloc.html" class="olink">DB_ENV->set_alloc()</a>.</dd> 71 <dt> 72 <span class="term">log_archive</span> 73 </dt> 74 <dd>The historic <span class="bold"><strong>db_malloc</strong></span> argument to the log_archive function has 75been replaced. Applications using this function should do as follows: 76if the argument is NULL, it should simply be removed. If non-NULL, 77it should be replaced with a call to <a href="../api_reference/C/envset_alloc.html" class="olink">DB_ENV->set_alloc()</a>.</dd> 78 <dt> 79 <span class="term">log_stat</span> 80 </dt> 81 <dd>The historic <span class="bold"><strong>db_malloc</strong></span> argument to the log_stat function has 82been replaced. Applications using this function should do as follows: 83if the argument is NULL, it should simply be removed. If non-NULL, 84it should be replaced with a call to <a href="../api_reference/C/envset_alloc.html" class="olink">DB_ENV->set_alloc()</a>.</dd> 85 <dt> 86 <span class="term">memp_stat</span> 87 </dt> 88 <dd>The historic <span class="bold"><strong>db_malloc</strong></span> argument to the memp_stat function has 89been replaced. Applications using this function should do as follows: 90if the argument is NULL, it should simply be removed. If non-NULL, 91it should be replaced with a call to <a href="../api_reference/C/envset_alloc.html" class="olink">DB_ENV->set_alloc()</a>.</dd> 92 <dt> 93 <span class="term">txn_stat</span> 94 </dt> 95 <dd>The historic <span class="bold"><strong>db_malloc</strong></span> argument to the txn_stat function has 96been replaced. Applications using this function should do as follows: 97if the argument is NULL, it should simply be removed. If non-NULL, 98it should be replaced with a call to <a href="../api_reference/C/envset_alloc.html" class="olink">DB_ENV->set_alloc()</a>.</dd> 99 </dl> 100 </div> 101 <p>One potential incompatibility for historic applications is that the 102allocation functions for a database environment must now be set before 103the environment is opened. Historically, Berkeley DB applications could open 104the environment first, and subsequently call the DB->set_malloc 105and DB->set_realloc methods; that use is no longer supported.</p> 106 </div> 107 <div class="navfooter"> 108 <hr /> 109 <table width="100%" summary="Navigation footer"> 110 <tr> 111 <td width="40%" align="left"><a accesskey="p" href="upgrade_3_3_getswap.html">Prev</a>��</td> 112 <td width="20%" align="center"> 113 <a accesskey="u" href="upgrade_3_3_toc.html">Up</a> 114 </td> 115 <td width="40%" align="right">��<a accesskey="n" href="upgrade_3_3_conflict.html">Next</a></td> 116 </tr> 117 <tr> 118 <td width="40%" align="left" valign="top">Release 3.3: DB->get_byteswapped��</td> 119 <td width="20%" align="center"> 120 <a accesskey="h" href="index.html">Home</a> 121 </td> 122 <td width="40%" align="right" valign="top">��Release 3.3: DB_LOCK_CONFLICT</td> 123 </tr> 124 </table> 125 </div> 126 </body> 127</html> 128