Berkeley DB Reference Guide:
Upgrading Berkeley DB Applications
PrevRefNext

Release 3.3: DB->set_malloc, DB->set_realloc

There are two new methods in the Berkeley DB 3.3 release: DB_ENV->set_alloc and DB->set_alloc. 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.

The new methods affect or replace the following historic methods:


DB->set_malloc DB->set_realloc DB->stat lock_stat log_archive log_stat memp_stat txn_stat

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->set_malloc and DB->set_realloc methods; that use is no longer supported.


PrevRefNext

Copyright (c) 1996,2008 Oracle. All rights reserved.