]> git.sur5r.net Git - openldap/commitdiff
Set BDB's global allocators to ber_*, don't bother with the per-env setting.
authorHoward Chu <hyc@openldap.org>
Thu, 12 Sep 2002 02:47:18 +0000 (02:47 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 12 Sep 2002 02:47:18 +0000 (02:47 +0000)
servers/slapd/back-bdb/init.c

index 64ef4952aa2941698be8ff973de32e76f088d092..4b5f366b85a283582525f8db541026d1221512ae 100644 (file)
@@ -186,6 +186,10 @@ bdb_db_open( BackendDB *be )
                be->be_suffix[0].bv_val, 0, 0 );
 #endif
 
+       db_env_set_func_free( ber_memfree );
+       db_env_set_func_malloc( ber_memalloc );
+       db_env_set_func_realloc( ber_memrealloc );
+
        /* we should check existance of dbenv_home and db_directory */
 
        rc = db_env_create( &bdb->bi_dbenv, 0 );
@@ -202,9 +206,6 @@ bdb_db_open( BackendDB *be )
                return rc;
        }
 
-       bdb->bi_dbenv->set_alloc( bdb->bi_dbenv, (db_malloc *)ber_memalloc,
-               (db_realloc *)ber_memrealloc, ber_memfree );
-
        flags = DB_INIT_MPOOL | DB_THREAD | DB_CREATE
                | DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_TXN;