Tidy up stats interface

This commit is contained in:
whydoubt
2004-08-19 05:12:21 +00:00
parent 9a4b90878a
commit 1960e3808b
4 changed files with 2 additions and 19 deletions

View File

@@ -168,8 +168,8 @@ void
mdb_close(MdbHandle *mdb)
{
if (!mdb) return;
mdb_free_stats(mdb);
mdb_free_catalog(mdb);
g_free(mdb->stats);
g_free(mdb->backend_name);
if (mdb->f) {

View File

@@ -23,20 +23,6 @@
#include "dmalloc.h"
#endif
/* private function */
MdbStatistics *mdb_alloc_stats(MdbHandle *mdb)
{
mdb->stats = g_malloc0(sizeof(MdbStatistics));
return mdb->stats;
}
/* private function */
void mdb_free_stats(MdbHandle *mdb)
{
if (!mdb->stats) return;
g_free(mdb->stats);
mdb->stats = NULL;
}
/**
* mdb_stats_on:
* @mdb: Handle to the (open) MDB file to collect stats on.
@@ -53,7 +39,7 @@ void
mdb_stats_on(MdbHandle *mdb)
{
if (!mdb->stats)
mdb_alloc_stats(mdb);
mdb->stats = g_malloc0(sizeof(MdbStatistics));
mdb->stats->collect = TRUE;
}