alloc.html   [plain text]


<!--$Id: alloc.html,v 1.1.1.1 2003/02/15 04:56:04 zarzycki Exp $-->
<!--Copyright 1997-2002 by Sleepycat Software, Inc.-->
<!--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,b+tree,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><h3><dl><dt>Berkeley DB Reference Guide:<dd>Upgrading Berkeley DB Applications</dl></h3></td>
<td align=right><a href="../../ref/upgrade.3.3/getswap.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../../reftoc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../../ref/upgrade.3.3/conflict.html"><img src="../../images/next.gif" alt="Next"></a>
</td></tr></table>
<p>
<h1 align=center>Release 3.3: DB-&gt;set_malloc, DB-&gt;set_realloc</h1>
<p>There are two new interfaces 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>The new interfaces affect or replace the following historic
interfaces:
<p><dl compact>
<p><dt>DB-&gt;set_malloc<dd>The DB-&gt;set_malloc interface has been replaced in its entirety.
Applications using this interface should replace the call with a call
to <a href="../../api_c/db_set_alloc.html">DB-&gt;set_alloc</a>.
<p><dt>DB-&gt;set_realloc<dd>The DB-&gt;set_realloc interface has been replaced in its entirety.
Applications using this interface should replace the call with a call
to <a href="../../api_c/db_set_alloc.html">DB-&gt;set_alloc</a>.
<p><dt><a href="../../api_c/db_stat.html">DB-&gt;stat</a><dd>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 interface 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>.
<p><dt>lock_stat<dd>The historic <b>db_malloc</b> argument to the lock_stat interface has
been replaced.  Applications using this interface 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>.
<p><dt>log_archive<dd>The historic <b>db_malloc</b> argument to the log_archive interface has
been replaced.  Applications using this interface 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>.
<p><dt>log_stat<dd>The historic <b>db_malloc</b> argument to the log_stat interface has
been replaced.  Applications using this interface 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>.
<p><dt>memp_stat<dd>The historic <b>db_malloc</b> argument to the memp_stat function has
been replaced.  Applications using this interface 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>.
<p><dt>txn_stat<dd>The historic <b>db_malloc</b> argument to the txn_stat function has
been replaced.  Applications using this interface 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>.
</dl>
<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 interfaces; that use is no longer supported.
<table width="100%"><tr><td><br></td><td align=right><a href="../../ref/upgrade.3.3/getswap.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../../reftoc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../../ref/upgrade.3.3/conflict.html"><img src="../../images/next.gif" alt="Next"></a>
</td></tr></table>
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>
</body>
</html>