June 2001
Intermediate to advanced
688 pages
19h 18m
English
#include <db.h> int DB→set_realloc(DB *db, void *(*db_realloc_fcn)(void *ptr, size_t size));
Set the realloc function used by the DB methods to allocate memory in which to return key/data items to the application.
The DB_DBT_REALLOC flag, when specified in the DBT object, will cause the DB methods to allocate and re-allocate memory which then becomes the responsibility of the calling application. See DBT for more information.
On systems where there may be multiple library versions of realloc (notably Windows NT), specifying the DB_DBT_REALLOC flag will fail because the DB library will allocate memory from a different heap than the application will use to free it. To avoid this problem, the DBset_realloc function ...