From d3669fab53560a04eef02f524e1bbc58ad86cc0a Mon Sep 17 00:00:00 2001 From: Patrick Pelissier Date: Thu, 20 Jul 2017 13:40:40 +0200 Subject: [PATCH] Fix issue: do not compute the good result of the benchmark. --- bench/bench-glib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bench/bench-glib.c b/bench/bench-glib.c index ef74fa0d..7b049c0a 100644 --- a/bench/bench-glib.c +++ b/bench/bench-glib.c @@ -66,12 +66,12 @@ static int compare(gconstpointer a, gconstpointer b, gpointer user_data) static void test_rbtree(size_t n) { - GTree *tree = g_tree_new_full(compare, NULL, free, free); + GTree *tree = g_tree_new_full(compare, NULL, free, NULL); for (size_t i = 0; i < n; i++) { // NOTE: unsigned long are not designed to work with GPOINTER_TO_INT according to documentation. unsigned long *p = malloc(sizeof(unsigned long)); *p = rand_get(); - g_tree_insert(tree, p, NULL); + g_tree_insert(tree, p, p); } rand_init(); unsigned int s = 0;