Move statistics functions to stats.c

This commit is contained in:
whydoubt
2004-06-23 12:43:38 +00:00
parent fc25bde6ca
commit ade1a8703b
4 changed files with 19 additions and 18 deletions

View File

@@ -48,19 +48,3 @@ void mdb_exit()
{
mdb_remove_backends();
}
/* private function */
MdbStatistics *mdb_alloc_stats(MdbHandle *mdb)
{
mdb->stats = g_malloc0(sizeof(MdbStatistics));
return mdb->stats;
/* private function */
}
/* private function */
void
mdb_free_stats(MdbHandle *mdb)
{
if (!mdb->stats) return;
g_free(mdb->stats);
mdb->stats = NULL;
}

View File

@@ -23,6 +23,20 @@
#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.