summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd_statistics.c
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2010-01-08 17:35:20 +0000
committerAndrey Hristov <andrey@php.net>2010-01-08 17:35:20 +0000
commitd20fdd603bc01ba3910839a6f3b7d4094eba6a67 (patch)
treecde1e1822b62a92fd9b11b7d79641ca6a91b433a /ext/mysqlnd/mysqlnd_statistics.c
parent3264e51983b46ee4951a14b591e8d80a542551b5 (diff)
downloadphp-git-d20fdd603bc01ba3910839a6f3b7d4094eba6a67.tar.gz
improve the stats subsystem. Reduce the number of macro definitions
in half by smartly introducing 2 new macros. Make MYSQLND::stats a pointer from being aggregated and add triggers.
Diffstat (limited to 'ext/mysqlnd/mysqlnd_statistics.c')
-rw-r--r--ext/mysqlnd/mysqlnd_statistics.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/mysqlnd/mysqlnd_statistics.c b/ext/mysqlnd/mysqlnd_statistics.c
index ca3967e215..0f83e93324 100644
--- a/ext/mysqlnd/mysqlnd_statistics.c
+++ b/ext/mysqlnd/mysqlnd_statistics.c
@@ -240,6 +240,7 @@ void
mysqlnd_stats_init(MYSQLND_STATS ** stats)
{
*stats = calloc(1, sizeof(MYSQLND_STATS));
+ (*stats)->handlers = calloc(STAT_LAST, sizeof(mysqlnd_stat_handler));
#ifdef ZTS
(*stats)->LOCK_access = tsrm_mutex_alloc();
#endif
@@ -255,6 +256,7 @@ mysqlnd_stats_end(MYSQLND_STATS * stats)
#ifdef ZTS
tsrm_mutex_free(stats->LOCK_access);
#endif
+ free(stats->handlers);
/* mnd_free will reference LOCK_access and crash...*/
free(stats);
}