-I:Berkeley DB Reference Guide: Access Methods[P4

Berkeley DB Reference Guide: Access Methods



=

Non-local memory allocation (db_malloc)



HIt is possible in Berkeley DB to specify that returned key/data pairs beBcopied into allocated memory which then becomes the responsibilityvof the application. (See DB_DBT_MALLOC for further information.)

JOn systems where there may be multiple library versions of malloc (notablyOWindows NT), the Berkeley DB library will allocate memory from a different heapDthan the application will use to free it. To avoid this problem, theGallocation routine to be used for allocating such key/data items can bebspecified as part of the db_open call to open the database,ispecifically by setting the db_malloc element of the?DB_INFO structure. If no allocation function is specified, the7underlying C library malloc(3) function is used.

IALÿÿ