summaryrefslogtreecommitdiff
path: root/src/benchmarks/eo
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@samsung.com>2014-04-23 11:23:39 +0300
committerDaniel Zaoui <daniel.zaoui@samsung.com>2014-04-23 11:23:39 +0300
commit3c61dc1dba323e23acba623be778dae29ee7e505 (patch)
treee8baa1046eedbc7d067016de335b4c4f381ef5c1 /src/benchmarks/eo
parent026d7210c6764fd1bca6169484f24cbbea511712 (diff)
Eo: adapt benchmarks to Eo2.
Diffstat (limited to 'src/benchmarks/eo')
-rw-r--r--src/benchmarks/eo/class_simple.c28
-rw-r--r--src/benchmarks/eo/class_simple.h11
-rw-r--r--src/benchmarks/eo/eo_bench_eo_do.c20
3 files changed, 11 insertions, 48 deletions
diff --git a/src/benchmarks/eo/class_simple.c b/src/benchmarks/eo/class_simple.c
index 05d025ec97..ad5e631524 100644
--- a/src/benchmarks/eo/class_simple.c
+++ b/src/benchmarks/eo/class_simple.c
@@ -7,42 +7,28 @@
7 7
8#define MY_CLASS SIMPLE_CLASS 8#define MY_CLASS SIMPLE_CLASS
9 9
10EAPI Eo_Op SIMPLE_BASE_ID = 0;
11
12static void 10static void
13_a_set(Eo *obj EINA_UNUSED, void *class_data, va_list *list) 11_a_set(Eo *obj EINA_UNUSED, void *class_data, int a)
14{ 12{
15 Simple_Public_Data *pd = class_data; 13 Simple_Public_Data *pd = class_data;
16 int a;
17 a = va_arg(*list, int);
18
19 pd->a = a; 14 pd->a = a;
20} 15}
21 16
22static void 17EAPI EO_VOID_FUNC_BODYV(simple_a_set, EO_FUNC_CALL(a), int a);
23_class_constructor(Eo_Class *klass)
24{
25 const Eo_Op_Func_Description func_desc[] = {
26 EO_OP_FUNC(SIMPLE_ID(SIMPLE_SUB_ID_A_SET), _a_set),
27 EO_OP_FUNC_SENTINEL
28 };
29 18
30 eo_class_funcs_set(klass, func_desc); 19static Eo_Op_Description op_desc[] = {
31} 20 EO_OP_FUNC(simple_a_set, _a_set, "Set property A"),
32 21 EO_OP_SENTINEL
33static const Eo_Op_Description op_desc[] = {
34 EO_OP_DESCRIPTION(SIMPLE_SUB_ID_A_SET, "Set property A"),
35 EO_OP_DESCRIPTION_SENTINEL
36}; 22};
37 23
38static const Eo_Class_Description class_desc = { 24static const Eo_Class_Description class_desc = {
39 EO_VERSION, 25 EO_VERSION,
40 "Simple", 26 "Simple",
41 EO_CLASS_TYPE_REGULAR, 27 EO_CLASS_TYPE_REGULAR,
42 EO_CLASS_DESCRIPTION_OPS(&SIMPLE_BASE_ID, op_desc, SIMPLE_SUB_ID_LAST), 28 EO_CLASS_DESCRIPTION_OPS(op_desc),
43 NULL, 29 NULL,
44 sizeof(Simple_Public_Data), 30 sizeof(Simple_Public_Data),
45 _class_constructor, 31 NULL,
46 NULL 32 NULL
47}; 33};
48 34
diff --git a/src/benchmarks/eo/class_simple.h b/src/benchmarks/eo/class_simple.h
index b29e7987c1..99f6b80c09 100644
--- a/src/benchmarks/eo/class_simple.h
+++ b/src/benchmarks/eo/class_simple.h
@@ -1,21 +1,12 @@
1#ifndef SIMPLE_H 1#ifndef SIMPLE_H
2#define SIMPLE_H 2#define SIMPLE_H
3 3
4extern EAPI Eo_Op SIMPLE_BASE_ID;
5
6enum {
7 SIMPLE_SUB_ID_A_SET,
8 SIMPLE_SUB_ID_LAST
9};
10
11typedef struct 4typedef struct
12{ 5{
13 int a; 6 int a;
14} Simple_Public_Data; 7} Simple_Public_Data;
15 8
16#define SIMPLE_ID(sub_id) (SIMPLE_BASE_ID + sub_id) 9EAPI void simple_a_set(int a);
17
18#define simple_a_set(a) SIMPLE_ID(SIMPLE_SUB_ID_A_SET), EO_TYPECHECK(int, a)
19 10
20#define SIMPLE_CLASS simple_class_get() 11#define SIMPLE_CLASS simple_class_get()
21const Eo_Class *simple_class_get(void); 12const Eo_Class *simple_class_get(void);
diff --git a/src/benchmarks/eo/eo_bench_eo_do.c b/src/benchmarks/eo/eo_bench_eo_do.c
index 601290e191..7210d01a8e 100644
--- a/src/benchmarks/eo/eo_bench_eo_do.c
+++ b/src/benchmarks/eo/eo_bench_eo_do.c
@@ -22,36 +22,22 @@ bench_eo_do_general(int request)
22static const Eo_Class *cur_klass; 22static const Eo_Class *cur_klass;
23 23
24static void 24static void
25_a_set(Eo *obj, void *class_data EINA_UNUSED, va_list *list) 25_a_set(Eo *obj, void *class_data EINA_UNUSED, int a)
26{ 26{
27 int a;
28 a = va_arg(*list, int);
29
30 eo_do_super(obj, cur_klass, simple_a_set(a)); 27 eo_do_super(obj, cur_klass, simple_a_set(a));
31} 28}
32 29
33static void 30static void
34_class_constructor(Eo_Class *klass)
35{
36 const Eo_Op_Func_Description func_desc[] = {
37 EO_OP_FUNC(SIMPLE_ID(SIMPLE_SUB_ID_A_SET), _a_set),
38 EO_OP_FUNC_SENTINEL
39 };
40
41 eo_class_funcs_set(klass, func_desc);
42}
43
44static void
45bench_eo_do_super(int request) 31bench_eo_do_super(int request)
46{ 32{
47 static Eo_Class_Description class_desc = { 33 static Eo_Class_Description class_desc = {
48 EO_VERSION, 34 EO_VERSION,
49 "Simple2", 35 "Simple2",
50 EO_CLASS_TYPE_REGULAR, 36 EO_CLASS_TYPE_REGULAR,
51 EO_CLASS_DESCRIPTION_OPS(NULL, NULL, 0), 37 EO_CLASS_DESCRIPTION_NOOPS(),
52 NULL, 38 NULL,
53 0, 39 0,
54 _class_constructor, 40 NULL,
55 NULL 41 NULL
56 }; 42 };
57 cur_klass = eo_class_new(&class_desc, SIMPLE_CLASS, NULL); 43 cur_klass = eo_class_new(&class_desc, SIMPLE_CLASS, NULL);