summaryrefslogtreecommitdiff
path: root/src/benchmarks
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-11-19 13:13:07 +0000
committerGustavo Lima Chaves <glima@profusion.mobi>2012-11-19 13:13:07 +0000
commitfbf199f004b1e1139ef2f8eeb6b6d8b4b2970cbd (patch)
treeddb84fbde76ab739d738a66e8b7260f34f4ed3c4 /src/benchmarks
parentc1672ed8cfcc1fcaa665412c99173b57dd551bd3 (diff)
[eina] cleans up and fixes 'make benchmark'
saddly eina_bench stills segv and as I can't find any install target for it, and I'm not a kung-auto-foo warrior, I can't gdb it. could someone provide a benchmark-install target or point me to the direction I missed? Patch by: Jérémy Zurcher <jeremy@asynk.ch> SVN revision: 79448
Diffstat (limited to 'src/benchmarks')
-rw-r--r--src/benchmarks/eina/Ecore_Data.h2
-rw-r--r--src/benchmarks/eina/ecore_strings.c9
-rw-r--r--src/benchmarks/eina/eina_bench_stringshare_e17.c23
-rw-r--r--src/benchmarks/eina/evas_mempool.c2
4 files changed, 20 insertions, 16 deletions
diff --git a/src/benchmarks/eina/Ecore_Data.h b/src/benchmarks/eina/Ecore_Data.h
index 50d42f1fe2..415efc7e56 100644
--- a/src/benchmarks/eina/Ecore_Data.h
+++ b/src/benchmarks/eina/Ecore_Data.h
@@ -416,7 +416,7 @@ struct _ecore_string
416}; 416};
417 417
418EAPI int ecore_string_init(); 418EAPI int ecore_string_init();
419EAPI void ecore_string_shutdown(); 419EAPI int ecore_string_shutdown();
420EAPI const char *ecore_string_instance(const char *string); 420EAPI const char *ecore_string_instance(const char *string);
421EAPI void ecore_string_release(const char *string); 421EAPI void ecore_string_release(const char *string);
422 422
diff --git a/src/benchmarks/eina/ecore_strings.c b/src/benchmarks/eina/ecore_strings.c
index d76e4c5f5e..15deae6b8f 100644
--- a/src/benchmarks/eina/ecore_strings.c
+++ b/src/benchmarks/eina/ecore_strings.c
@@ -33,7 +33,7 @@ static int ecore_string_init_count = 0;
33 * @return Zero on failure, non-zero on successful initialization. 33 * @return Zero on failure, non-zero on successful initialization.
34 */ 34 */
35EAPI int 35EAPI int
36ecore_string_init() 36ecore_string_init(void)
37{ 37{
38 /* 38 /*
39 * No strings have been loaded at this point, so create the hash 39 * No strings have been loaded at this point, so create the hash
@@ -138,9 +138,11 @@ ecore_string_hash_dump_stats(void)
138 138
139/** 139/**
140 * Shutdown the ecore string internal structures 140 * Shutdown the ecore string internal structures
141 * @return 0 when the module is completely shut down, 1 or
142 * greater otherwise.
141 */ 143 */
142EAPI void 144EAPI int
143ecore_string_shutdown() 145ecore_string_shutdown(void)
144{ 146{
145 --ecore_string_init_count; 147 --ecore_string_init_count;
146 if (!ecore_string_init_count) 148 if (!ecore_string_init_count)
@@ -148,6 +150,7 @@ ecore_string_shutdown()
148 ecore_hash_destroy(ecore_strings); 150 ecore_hash_destroy(ecore_strings);
149 ecore_strings = NULL; 151 ecore_strings = NULL;
150 } 152 }
153 return ecore_string_init_count;
151} 154}
152 155
153static void 156static void
diff --git a/src/benchmarks/eina/eina_bench_stringshare_e17.c b/src/benchmarks/eina/eina_bench_stringshare_e17.c
index 6ab0a807ea..505374df77 100644
--- a/src/benchmarks/eina/eina_bench_stringshare_e17.c
+++ b/src/benchmarks/eina/eina_bench_stringshare_e17.c
@@ -57,10 +57,10 @@ static Eina_Stringshare_Test eina_str = {
57 57
58static Eina_Stringshare_Test evas_str = { 58static Eina_Stringshare_Test evas_str = {
59 "evas", 59 "evas",
60/* evas_stringshare_init, */ 60 NULL,
61 evas_stringshare_add, 61 evas_stringshare_add,
62 evas_stringshare_del 62 evas_stringshare_del,
63/* evas_stringshare_shutdown */ 63 NULL
64}; 64};
65 65
66static Eina_Stringshare_Test ecore_str = { 66static Eina_Stringshare_Test ecore_str = {
@@ -71,7 +71,7 @@ static Eina_Stringshare_Test ecore_str = {
71 ecore_string_shutdown 71 ecore_string_shutdown
72}; 72};
73 73
74static Eina_Stringshare_Test *str[] = { 74static Eina_Stringshare_Test *tests[] = {
75 &eina_str, 75 &eina_str,
76 &evas_str, 76 &evas_str,
77 &ecore_str, 77 &ecore_str,
@@ -87,16 +87,17 @@ eina_bench_e17_stringshare(Eina_Stringshare_Test *str)
87 87
88 eina_counter_start(cnt); 88 eina_counter_start(cnt);
89 89
90 str->init(); 90 if (str->init)
91 str->init();
91 92
92#include "strlog" 93//#include "strlog"
93 94
94 str->shutdown(); 95 if (str->shutdown)
96 str->shutdown();
95 97
96 eina_counter_stop(cnt, 1); 98 eina_counter_stop(cnt, 1);
97 99
98 fprintf(stderr, "For `%s`:\n", str->name); 100 fprintf(stderr, "For `%s`:\n%s\n", str->name,eina_counter_dump(cnt));
99 eina_counter_dump(cnt);
100 101
101 eina_counter_free(cnt); 102 eina_counter_free(cnt);
102} 103}
@@ -110,8 +111,8 @@ eina_bench_e17(void)
110 111
111 eina_init(); 112 eina_init();
112 113
113 for (i = 0; str[i]; ++i) 114 for (i = 0; tests[i]; ++i)
114 eina_bench_e17_stringshare(str[i]); 115 eina_bench_e17_stringshare(tests[i]);
115 116
116 eina_shutdown(); 117 eina_shutdown();
117#endif 118#endif
diff --git a/src/benchmarks/eina/evas_mempool.c b/src/benchmarks/eina/evas_mempool.c
index 921b7dfafb..fbc48fa19a 100644
--- a/src/benchmarks/eina/evas_mempool.c
+++ b/src/benchmarks/eina/evas_mempool.c
@@ -56,7 +56,7 @@ _evas_mp_pool_free(Pool *p)
56} 56}
57 57
58void * 58void *
59evas_mempool_malloc(Evas_Mempool *pool, int size EINA_UNUSED) 59evas_mempool_malloc(Evas_Mempool *pool, int size)
60{ 60{
61#ifdef NOPOOL 61#ifdef NOPOOL
62 return malloc(size); 62 return malloc(size);