1I.Berkeley DB: DbInfo::set_malloc[P

DbInfo::set_malloc





#include <db_cxx.h>

'typedef void *(*db_malloc_fcn)(size_t);'void DbInfo::set_malloc(db_malloc_fcn);





Description



YSet the malloc function used by the Db methods.

iThe DB_DBT_MALLOC flag, when specified in the Dbt object, willhcause the Db methods to allocate memory which then becomes the*responsibility of the calling application.HSee Dbt for more information.

AOn systems where there may be multiple library versions of mallocA(notably Windows NT), specifying the DB_DBT_MALLOC flag will failkbecause the Db library will allocate memory from a different heap)than the application will use to free it.BTo avoid this problem, the malloc function should be set to.point to the application's allocation routine.CIf malloc is not explicitly set, it will be used to allocate7the memory returned when the DB_DBT_MALLOC flag is set.BThe malloc method must match the calling conventions of the!malloc(3) library routine.



Class

4DbInfo



See Also

NDbInfo::set_bt_compare,LDbInfo::set_bt_maxkey,LDbInfo::set_bt_minkey,LDbInfo::set_bt_prefix,LDbInfo::set_cachesize,HDbInfo::set_compare,DDbInfo::set_flags,LDbInfo::set_h_ffactor,FDbInfo::set_h_hash,HDbInfo::set_h_nelem,FDbInfo::set_lorder,DbInfo::set_malloc,JDbInfo::set_pagesize,JDbInfo::set_re_delim,FDbInfo::set_re_len,EDbInfo::set_re_padandLDbInfo::set_re_source.
ÿÿ