summaryrefslogtreecommitdiff
path: root/dbus/dbus-mempool.c
diff options
context:
space:
mode:
authorChengwei Yang <chengwei.yang@intel.com>2013-06-21 17:58:56 +0800
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2013-06-26 13:00:30 +0100
commit11516f65d0a7a8f5b5c61ab53aac4e4cf3ec9a15 (patch)
treedb2255ecdf2e9f814a5823438f0eb399fb05ba88 /dbus/dbus-mempool.c
parente7503d188a4d9e3c9c827f16e85580cdd239ef55 (diff)
downloaddbus-11516f65d0a7a8f5b5c61ab53aac4e4cf3ec9a15.tar.gz
Fix build failure if build with tests but without verbose mode
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66005 Signed-off-by: Chengwei Yang <chengwei.yang@intel.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Diffstat (limited to 'dbus/dbus-mempool.c')
-rw-r--r--dbus/dbus-mempool.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/dbus/dbus-mempool.c b/dbus/dbus-mempool.c
index 0c3f117d..f1539933 100644
--- a/dbus/dbus-mempool.c
+++ b/dbus/dbus-mempool.c
@@ -459,8 +459,10 @@ time_for_size (int size)
{
int i;
int j;
+#ifdef DBUS_ENABLE_VERBOSE_MODE
clock_t start;
clock_t end;
+#endif
#define FREE_ARRAY_SIZE 512
#define N_ITERATIONS FREE_ARRAY_SIZE * 512
void *to_free[FREE_ARRAY_SIZE];
@@ -470,8 +472,10 @@ time_for_size (int size)
_dbus_verbose (" malloc\n");
+#ifdef DBUS_ENABLE_VERBOSE_MODE
start = clock ();
-
+#endif
+
i = 0;
j = 0;
while (i < N_ITERATIONS)
@@ -496,6 +500,7 @@ time_for_size (int size)
++i;
}
+#ifdef DBUS_ENABLE_VERBOSE_MODE
end = clock ();
_dbus_verbose (" created/destroyed %d elements in %g seconds\n",
@@ -506,6 +511,7 @@ time_for_size (int size)
_dbus_verbose (" mempools\n");
start = clock ();
+#endif
pool = _dbus_mem_pool_new (size, FALSE);
@@ -535,6 +541,7 @@ time_for_size (int size)
_dbus_mem_pool_free (pool);
+#ifdef DBUS_ENABLE_VERBOSE_MODE
end = clock ();
_dbus_verbose (" created/destroyed %d elements in %g seconds\n",
@@ -543,6 +550,7 @@ time_for_size (int size)
_dbus_verbose (" zeroed malloc\n");
start = clock ();
+#endif
i = 0;
j = 0;
@@ -568,6 +576,7 @@ time_for_size (int size)
++i;
}
+#ifdef DBUS_ENABLE_VERBOSE_MODE
end = clock ();
_dbus_verbose (" created/destroyed %d elements in %g seconds\n",
@@ -576,6 +585,7 @@ time_for_size (int size)
_dbus_verbose (" zeroed mempools\n");
start = clock ();
+#endif
pool = _dbus_mem_pool_new (size, TRUE);
@@ -605,10 +615,12 @@ time_for_size (int size)
_dbus_mem_pool_free (pool);
+#ifdef DBUS_ENABLE_VERBOSE_MODE
end = clock ();
_dbus_verbose (" created/destroyed %d elements in %g seconds\n",
N_ITERATIONS, (end - start) / (double) CLOCKS_PER_SEC);
+#endif
}
/**