typedef void *(*db_malloc_fcn)(size_t); void DbInfo::set_malloc(db_malloc_fcn);
Set the malloc function used by the Db methods.
The DB_DBT_MALLOC flag, when specified in the Dbt object, will cause the Db methods to 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 malloc (notably Windows NT), specifying the DB_DBT_MALLOC 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 malloc function should be set to point to the application's allocation routine. If malloc is not explicitly set, it will be used to allocate the memory returned when the DB_DBT_MALLOC flag is set. The malloc method must match the calling conventions of the malloc(3) library routine.