alloc.html   [plain text]


<!--$Id: alloc.so,v 1.12 2004/08/13 03:39:00 bostic Exp $-->
<!--Copyright (c) 1997,2008 Oracle.  All rights reserved.-->
<!--See the file LICENSE for redistribution information.-->
<html>
<head>
<title>Berkeley DB Reference Guide: Release 3.3: DB-&gt;set_malloc, DB-&gt;set_realloc</title>
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++">
</head>
<body bgcolor=white>
<table width="100%"><tr valign=top>
<td><b><dl><dt>Berkeley DB Reference Guide:<dd>Upgrading Berkeley DB Applications</dl></b></td>
<td align=right><a href="../upgrade.3.3/getswap.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../upgrade.3.3/conflict.html"><img src="../../images/next.gif" alt="Next"></a>
</td></tr></table>
<p align=center><b>Release 3.3: DB-&gt;set_malloc, DB-&gt;set_realloc</b></p>
<p>There are two new methods in the Berkeley DB 3.3 release:
<a href="../../api_c/env_set_alloc.html">DB_ENV-&gt;set_alloc</a> and <a href="../../api_c/db_set_alloc.html">DB-&gt;set_alloc</a>.  These functions
allow applications to specify a set of allocation functions for the
Berkeley DB library to use when allocating memory to be owned by the
application and when freeing memory that was originally allocated by the
application.</p>
<p>The new methods affect or replace the following historic methods:</p>
<br>
<b>DB-&gt;set_malloc</b><ul compact><li>The DB-&gt;set_malloc method has been replaced in its entirety.
Applications using this method should replace the call with a call
to <a href="../../api_c/db_set_alloc.html">DB-&gt;set_alloc</a>.</ul>
<b>DB-&gt;set_realloc</b><ul compact><li>The DB-&gt;set_realloc method has been replaced in its entirety.
Applications using this method should replace the call with a call
to <a href="../../api_c/db_set_alloc.html">DB-&gt;set_alloc</a>.</ul>
<b><a href="../../api_c/db_stat.html">DB-&gt;stat</a></b><ul compact><li>The historic <b>db_malloc</b> argument to the <a href="../../api_c/db_stat.html">DB-&gt;stat</a> method has
been replaced.  Applications using this method should do as follows:
if the argument is NULL, it should simply be removed.  If non-NULL,
it should be replaced with a call to <a href="../../api_c/db_set_alloc.html">DB-&gt;set_alloc</a>.</ul>
<b>lock_stat</b><ul compact><li>The historic <b>db_malloc</b> argument to the lock_stat function has
been replaced.  Applications using this function should do as follows:
if the argument is NULL, it should simply be removed.  If
non-NULL, it should be replaced with a call to <a href="../../api_c/env_set_alloc.html">DB_ENV-&gt;set_alloc</a>.</ul>
<b>log_archive</b><ul compact><li>The historic <b>db_malloc</b> argument to the log_archive function has
been replaced.  Applications using this function should do as follows:
if the argument is NULL, it should simply be removed.  If non-NULL,
it should be replaced with a call to <a href="../../api_c/env_set_alloc.html">DB_ENV-&gt;set_alloc</a>.</ul>
<b>log_stat</b><ul compact><li>The historic <b>db_malloc</b> argument to the log_stat function has
been replaced.  Applications using this function should do as follows:
if the argument is NULL, it should simply be removed.  If non-NULL,
it should be replaced with a call to <a href="../../api_c/env_set_alloc.html">DB_ENV-&gt;set_alloc</a>.</ul>
<b>memp_stat</b><ul compact><li>The historic <b>db_malloc</b> argument to the memp_stat function has
been replaced.  Applications using this function should do as follows:
if the argument is NULL, it should simply be removed.  If non-NULL,
it should be replaced with a call to <a href="../../api_c/env_set_alloc.html">DB_ENV-&gt;set_alloc</a>.</ul>
<b>txn_stat</b><ul compact><li>The historic <b>db_malloc</b> argument to the txn_stat function has
been replaced.  Applications using this function should do as follows:
if the argument is NULL, it should simply be removed.  If non-NULL,
it should be replaced with a call to <a href="../../api_c/env_set_alloc.html">DB_ENV-&gt;set_alloc</a>.</ul>
<br>
<p>One potential incompatibility for historic applications is that the
allocation functions for a database environment must now be set before
the environment is opened.  Historically, Berkeley DB applications could open
the environment first, and subsequently call the DB-&gt;set_malloc
and DB-&gt;set_realloc methods; that use is no longer supported.</p>
<table width="100%"><tr><td><br></td><td align=right><a href="../upgrade.3.3/getswap.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../upgrade.3.3/conflict.html"><img src="../../images/next.gif" alt="Next"></a>
</td></tr></table>
<p><font size=1>Copyright (c) 1996,2008 Oracle.  All rights reserved.</font>
</body>
</html>