1 /* benchmark.c generated by valac 0.46.6, the Vala compiler
2  * generated from benchmark.vala, do not modify */
3 
4 /* benchmark.vala
5  *
6  * Copyright (C) 2008  Jürg Billeter
7  * Copyright (C) 2009  Didier Villevalois
8 
9  *
10  * This library is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 2.1 of the License, or (at your option) any later version.
14 
15  * This library is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18  * Lesser General Public License for more details.
19 
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with this library; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
23  *
24  * Author:
25  * 	Didier 'Ptitjes Villevalois <ptitjes@free.fr>
26  */
27 
28 #include <stdlib.h>
29 #include <string.h>
30 #include <glib.h>
31 #include <stdio.h>
32 #include <glib-object.h>
33 #include <gee-internals.h>
34 #include <math.h>
35 #include <float.h>
36 
37 #define _g_option_context_free0(var) ((var == NULL) ? NULL : (var = (g_option_context_free (var), NULL)))
38 #define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
39 
40 #define GEE_BENCHMARK_TYPE_FACTORY (gee_benchmark_factory_get_type ())
41 #define GEE_BENCHMARK_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_BENCHMARK_TYPE_FACTORY, GeeBenchmarkFactory))
42 #define GEE_BENCHMARK_IS_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_BENCHMARK_TYPE_FACTORY))
43 #define GEE_BENCHMARK_FACTORY_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_BENCHMARK_TYPE_FACTORY, GeeBenchmarkFactoryIface))
44 
45 typedef struct _GeeBenchmarkFactory GeeBenchmarkFactory;
46 typedef struct _GeeBenchmarkFactoryIface GeeBenchmarkFactoryIface;
47 
48 #define GEE_BENCHMARK_TYPE_GENERATOR (gee_benchmark_generator_get_type ())
49 #define GEE_BENCHMARK_GENERATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_BENCHMARK_TYPE_GENERATOR, GeeBenchmarkGenerator))
50 #define GEE_BENCHMARK_IS_GENERATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_BENCHMARK_TYPE_GENERATOR))
51 #define GEE_BENCHMARK_GENERATOR_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_BENCHMARK_TYPE_GENERATOR, GeeBenchmarkGeneratorIface))
52 
53 typedef struct _GeeBenchmarkGenerator GeeBenchmarkGenerator;
54 typedef struct _GeeBenchmarkGeneratorIface GeeBenchmarkGeneratorIface;
55 
56 #define GEE_BENCHMARK_TYPE_ALGORITHM (gee_benchmark_algorithm_get_type ())
57 #define GEE_BENCHMARK_ALGORITHM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_BENCHMARK_TYPE_ALGORITHM, GeeBenchmarkAlgorithm))
58 #define GEE_BENCHMARK_IS_ALGORITHM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_BENCHMARK_TYPE_ALGORITHM))
59 #define GEE_BENCHMARK_ALGORITHM_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GEE_BENCHMARK_TYPE_ALGORITHM, GeeBenchmarkAlgorithmIface))
60 
61 typedef struct _GeeBenchmarkAlgorithm GeeBenchmarkAlgorithm;
62 typedef struct _GeeBenchmarkAlgorithmIface GeeBenchmarkAlgorithmIface;
63 
64 #define GEE_BENCHMARK_TYPE_RANDOM_INT32 (gee_benchmark_random_int32_get_type ())
65 #define GEE_BENCHMARK_RANDOM_INT32(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_BENCHMARK_TYPE_RANDOM_INT32, GeeBenchmarkRandomInt32))
66 #define GEE_BENCHMARK_RANDOM_INT32_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_BENCHMARK_TYPE_RANDOM_INT32, GeeBenchmarkRandomInt32Class))
67 #define GEE_BENCHMARK_IS_RANDOM_INT32(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_BENCHMARK_TYPE_RANDOM_INT32))
68 #define GEE_BENCHMARK_IS_RANDOM_INT32_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_BENCHMARK_TYPE_RANDOM_INT32))
69 #define GEE_BENCHMARK_RANDOM_INT32_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_BENCHMARK_TYPE_RANDOM_INT32, GeeBenchmarkRandomInt32Class))
70 
71 typedef struct _GeeBenchmarkRandomInt32 GeeBenchmarkRandomInt32;
72 typedef struct _GeeBenchmarkRandomInt32Class GeeBenchmarkRandomInt32Class;
73 typedef struct _GeeBenchmarkRandomInt32Private GeeBenchmarkRandomInt32Private;
74 enum  {
75 	GEE_BENCHMARK_RANDOM_INT32_0_PROPERTY,
76 	GEE_BENCHMARK_RANDOM_INT32_NAME_PROPERTY,
77 	GEE_BENCHMARK_RANDOM_INT32_NUM_PROPERTIES
78 };
79 static GParamSpec* gee_benchmark_random_int32_properties[GEE_BENCHMARK_RANDOM_INT32_NUM_PROPERTIES];
80 
81 #define GEE_BENCHMARK_TYPE_FIXED_VARIANCE_INT32 (gee_benchmark_fixed_variance_int32_get_type ())
82 #define GEE_BENCHMARK_FIXED_VARIANCE_INT32(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_BENCHMARK_TYPE_FIXED_VARIANCE_INT32, GeeBenchmarkFixedVarianceInt32))
83 #define GEE_BENCHMARK_FIXED_VARIANCE_INT32_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_BENCHMARK_TYPE_FIXED_VARIANCE_INT32, GeeBenchmarkFixedVarianceInt32Class))
84 #define GEE_BENCHMARK_IS_FIXED_VARIANCE_INT32(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_BENCHMARK_TYPE_FIXED_VARIANCE_INT32))
85 #define GEE_BENCHMARK_IS_FIXED_VARIANCE_INT32_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_BENCHMARK_TYPE_FIXED_VARIANCE_INT32))
86 #define GEE_BENCHMARK_FIXED_VARIANCE_INT32_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_BENCHMARK_TYPE_FIXED_VARIANCE_INT32, GeeBenchmarkFixedVarianceInt32Class))
87 
88 typedef struct _GeeBenchmarkFixedVarianceInt32 GeeBenchmarkFixedVarianceInt32;
89 typedef struct _GeeBenchmarkFixedVarianceInt32Class GeeBenchmarkFixedVarianceInt32Class;
90 typedef struct _GeeBenchmarkFixedVarianceInt32Private GeeBenchmarkFixedVarianceInt32Private;
91 enum  {
92 	GEE_BENCHMARK_FIXED_VARIANCE_INT32_0_PROPERTY,
93 	GEE_BENCHMARK_FIXED_VARIANCE_INT32_NAME_PROPERTY,
94 	GEE_BENCHMARK_FIXED_VARIANCE_INT32_NUM_PROPERTIES
95 };
96 static GParamSpec* gee_benchmark_fixed_variance_int32_properties[GEE_BENCHMARK_FIXED_VARIANCE_INT32_NUM_PROPERTIES];
97 
98 #define GEE_BENCHMARK_TYPE_MOUNTS_INT32 (gee_benchmark_mounts_int32_get_type ())
99 #define GEE_BENCHMARK_MOUNTS_INT32(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_BENCHMARK_TYPE_MOUNTS_INT32, GeeBenchmarkMountsInt32))
100 #define GEE_BENCHMARK_MOUNTS_INT32_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_BENCHMARK_TYPE_MOUNTS_INT32, GeeBenchmarkMountsInt32Class))
101 #define GEE_BENCHMARK_IS_MOUNTS_INT32(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_BENCHMARK_TYPE_MOUNTS_INT32))
102 #define GEE_BENCHMARK_IS_MOUNTS_INT32_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_BENCHMARK_TYPE_MOUNTS_INT32))
103 #define GEE_BENCHMARK_MOUNTS_INT32_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_BENCHMARK_TYPE_MOUNTS_INT32, GeeBenchmarkMountsInt32Class))
104 
105 typedef struct _GeeBenchmarkMountsInt32 GeeBenchmarkMountsInt32;
106 typedef struct _GeeBenchmarkMountsInt32Class GeeBenchmarkMountsInt32Class;
107 typedef struct _GeeBenchmarkMountsInt32Private GeeBenchmarkMountsInt32Private;
108 enum  {
109 	GEE_BENCHMARK_MOUNTS_INT32_0_PROPERTY,
110 	GEE_BENCHMARK_MOUNTS_INT32_NAME_PROPERTY,
111 	GEE_BENCHMARK_MOUNTS_INT32_NUM_PROPERTIES
112 };
113 static GParamSpec* gee_benchmark_mounts_int32_properties[GEE_BENCHMARK_MOUNTS_INT32_NUM_PROPERTIES];
114 
115 #define GEE_BENCHMARK_TYPE_REVERSE_SORTED_INT32 (gee_benchmark_reverse_sorted_int32_get_type ())
116 #define GEE_BENCHMARK_REVERSE_SORTED_INT32(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_BENCHMARK_TYPE_REVERSE_SORTED_INT32, GeeBenchmarkReverseSortedInt32))
117 #define GEE_BENCHMARK_REVERSE_SORTED_INT32_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_BENCHMARK_TYPE_REVERSE_SORTED_INT32, GeeBenchmarkReverseSortedInt32Class))
118 #define GEE_BENCHMARK_IS_REVERSE_SORTED_INT32(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_BENCHMARK_TYPE_REVERSE_SORTED_INT32))
119 #define GEE_BENCHMARK_IS_REVERSE_SORTED_INT32_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_BENCHMARK_TYPE_REVERSE_SORTED_INT32))
120 #define GEE_BENCHMARK_REVERSE_SORTED_INT32_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_BENCHMARK_TYPE_REVERSE_SORTED_INT32, GeeBenchmarkReverseSortedInt32Class))
121 
122 typedef struct _GeeBenchmarkReverseSortedInt32 GeeBenchmarkReverseSortedInt32;
123 typedef struct _GeeBenchmarkReverseSortedInt32Class GeeBenchmarkReverseSortedInt32Class;
124 typedef struct _GeeBenchmarkReverseSortedInt32Private GeeBenchmarkReverseSortedInt32Private;
125 enum  {
126 	GEE_BENCHMARK_REVERSE_SORTED_INT32_0_PROPERTY,
127 	GEE_BENCHMARK_REVERSE_SORTED_INT32_NAME_PROPERTY,
128 	GEE_BENCHMARK_REVERSE_SORTED_INT32_NUM_PROPERTIES
129 };
130 static GParamSpec* gee_benchmark_reverse_sorted_int32_properties[GEE_BENCHMARK_REVERSE_SORTED_INT32_NUM_PROPERTIES];
131 
132 #define GEE_BENCHMARK_TYPE_SORTED_INT32 (gee_benchmark_sorted_int32_get_type ())
133 #define GEE_BENCHMARK_SORTED_INT32(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_BENCHMARK_TYPE_SORTED_INT32, GeeBenchmarkSortedInt32))
134 #define GEE_BENCHMARK_SORTED_INT32_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_BENCHMARK_TYPE_SORTED_INT32, GeeBenchmarkSortedInt32Class))
135 #define GEE_BENCHMARK_IS_SORTED_INT32(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_BENCHMARK_TYPE_SORTED_INT32))
136 #define GEE_BENCHMARK_IS_SORTED_INT32_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_BENCHMARK_TYPE_SORTED_INT32))
137 #define GEE_BENCHMARK_SORTED_INT32_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_BENCHMARK_TYPE_SORTED_INT32, GeeBenchmarkSortedInt32Class))
138 
139 typedef struct _GeeBenchmarkSortedInt32 GeeBenchmarkSortedInt32;
140 typedef struct _GeeBenchmarkSortedInt32Class GeeBenchmarkSortedInt32Class;
141 typedef struct _GeeBenchmarkSortedInt32Private GeeBenchmarkSortedInt32Private;
142 enum  {
143 	GEE_BENCHMARK_SORTED_INT32_0_PROPERTY,
144 	GEE_BENCHMARK_SORTED_INT32_NAME_PROPERTY,
145 	GEE_BENCHMARK_SORTED_INT32_NUM_PROPERTIES
146 };
147 static GParamSpec* gee_benchmark_sorted_int32_properties[GEE_BENCHMARK_SORTED_INT32_NUM_PROPERTIES];
148 
149 #define GEE_BENCHMARK_TYPE_ARRAY_LIST_FACTORY (gee_benchmark_array_list_factory_get_type ())
150 #define GEE_BENCHMARK_ARRAY_LIST_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_BENCHMARK_TYPE_ARRAY_LIST_FACTORY, GeeBenchmarkArrayListFactory))
151 #define GEE_BENCHMARK_ARRAY_LIST_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_BENCHMARK_TYPE_ARRAY_LIST_FACTORY, GeeBenchmarkArrayListFactoryClass))
152 #define GEE_BENCHMARK_IS_ARRAY_LIST_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_BENCHMARK_TYPE_ARRAY_LIST_FACTORY))
153 #define GEE_BENCHMARK_IS_ARRAY_LIST_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_BENCHMARK_TYPE_ARRAY_LIST_FACTORY))
154 #define GEE_BENCHMARK_ARRAY_LIST_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_BENCHMARK_TYPE_ARRAY_LIST_FACTORY, GeeBenchmarkArrayListFactoryClass))
155 
156 typedef struct _GeeBenchmarkArrayListFactory GeeBenchmarkArrayListFactory;
157 typedef struct _GeeBenchmarkArrayListFactoryClass GeeBenchmarkArrayListFactoryClass;
158 typedef struct _GeeBenchmarkArrayListFactoryPrivate GeeBenchmarkArrayListFactoryPrivate;
159 enum  {
160 	GEE_BENCHMARK_ARRAY_LIST_FACTORY_0_PROPERTY,
161 	GEE_BENCHMARK_ARRAY_LIST_FACTORY_G_TYPE,
162 	GEE_BENCHMARK_ARRAY_LIST_FACTORY_G_DUP_FUNC,
163 	GEE_BENCHMARK_ARRAY_LIST_FACTORY_G_DESTROY_FUNC,
164 	GEE_BENCHMARK_ARRAY_LIST_FACTORY_NUM_PROPERTIES
165 };
166 static GParamSpec* gee_benchmark_array_list_factory_properties[GEE_BENCHMARK_ARRAY_LIST_FACTORY_NUM_PROPERTIES];
167 #define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
168 
169 #define GEE_BENCHMARK_TYPE_BENCHMARK (gee_benchmark_benchmark_get_type ())
170 #define GEE_BENCHMARK_BENCHMARK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GEE_BENCHMARK_TYPE_BENCHMARK, GeeBenchmarkBenchmark))
171 #define GEE_BENCHMARK_BENCHMARK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GEE_BENCHMARK_TYPE_BENCHMARK, GeeBenchmarkBenchmarkClass))
172 #define GEE_BENCHMARK_IS_BENCHMARK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GEE_BENCHMARK_TYPE_BENCHMARK))
173 #define GEE_BENCHMARK_IS_BENCHMARK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GEE_BENCHMARK_TYPE_BENCHMARK))
174 #define GEE_BENCHMARK_BENCHMARK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GEE_BENCHMARK_TYPE_BENCHMARK, GeeBenchmarkBenchmarkClass))
175 
176 typedef struct _GeeBenchmarkBenchmark GeeBenchmarkBenchmark;
177 typedef struct _GeeBenchmarkBenchmarkClass GeeBenchmarkBenchmarkClass;
178 typedef struct _GeeBenchmarkBenchmarkPrivate GeeBenchmarkBenchmarkPrivate;
179 enum  {
180 	GEE_BENCHMARK_BENCHMARK_0_PROPERTY,
181 	GEE_BENCHMARK_BENCHMARK_G_TYPE,
182 	GEE_BENCHMARK_BENCHMARK_G_DUP_FUNC,
183 	GEE_BENCHMARK_BENCHMARK_G_DESTROY_FUNC,
184 	GEE_BENCHMARK_BENCHMARK_NUM_PROPERTIES
185 };
186 static GParamSpec* gee_benchmark_benchmark_properties[GEE_BENCHMARK_BENCHMARK_NUM_PROPERTIES];
187 #define _g_timer_destroy0(var) ((var == NULL) ? NULL : (var = (g_timer_destroy (var), NULL)))
188 
189 struct _GeeBenchmarkFactoryIface {
190 	GTypeInterface parent_iface;
191 	GeeCollection* (*create) (GeeBenchmarkFactory* self);
192 	GeeCollection* (*copy) (GeeBenchmarkFactory* self, GeeCollection* collection);
193 };
194 
195 struct _GeeBenchmarkGeneratorIface {
196 	GTypeInterface parent_iface;
197 	void (*generate_collection) (GeeBenchmarkGenerator* self, gint size, GeeCollection* collection);
198 	const gchar* (*get_name) (GeeBenchmarkGenerator* self);
199 };
200 
201 struct _GeeBenchmarkAlgorithmIface {
202 	GTypeInterface parent_iface;
203 	void (*process_collection) (GeeBenchmarkAlgorithm* self, GeeCollection* collection);
204 	const gchar* (*get_name) (GeeBenchmarkAlgorithm* self);
205 };
206 
207 struct _GeeBenchmarkRandomInt32 {
208 	GObject parent_instance;
209 	GeeBenchmarkRandomInt32Private * priv;
210 };
211 
212 struct _GeeBenchmarkRandomInt32Class {
213 	GObjectClass parent_class;
214 };
215 
216 struct _GeeBenchmarkFixedVarianceInt32 {
217 	GObject parent_instance;
218 	GeeBenchmarkFixedVarianceInt32Private * priv;
219 };
220 
221 struct _GeeBenchmarkFixedVarianceInt32Class {
222 	GObjectClass parent_class;
223 };
224 
225 struct _GeeBenchmarkMountsInt32 {
226 	GObject parent_instance;
227 	GeeBenchmarkMountsInt32Private * priv;
228 };
229 
230 struct _GeeBenchmarkMountsInt32Class {
231 	GObjectClass parent_class;
232 };
233 
234 struct _GeeBenchmarkReverseSortedInt32 {
235 	GObject parent_instance;
236 	GeeBenchmarkReverseSortedInt32Private * priv;
237 };
238 
239 struct _GeeBenchmarkReverseSortedInt32Class {
240 	GObjectClass parent_class;
241 };
242 
243 struct _GeeBenchmarkSortedInt32 {
244 	GObject parent_instance;
245 	GeeBenchmarkSortedInt32Private * priv;
246 };
247 
248 struct _GeeBenchmarkSortedInt32Class {
249 	GObjectClass parent_class;
250 };
251 
252 struct _GeeBenchmarkArrayListFactory {
253 	GObject parent_instance;
254 	GeeBenchmarkArrayListFactoryPrivate * priv;
255 };
256 
257 struct _GeeBenchmarkArrayListFactoryClass {
258 	GObjectClass parent_class;
259 };
260 
261 struct _GeeBenchmarkArrayListFactoryPrivate {
262 	GType g_type;
263 	GBoxedCopyFunc g_dup_func;
264 	GDestroyNotify g_destroy_func;
265 };
266 
267 struct _GeeBenchmarkBenchmark {
268 	GObject parent_instance;
269 	GeeBenchmarkBenchmarkPrivate * priv;
270 };
271 
272 struct _GeeBenchmarkBenchmarkClass {
273 	GObjectClass parent_class;
274 };
275 
276 struct _GeeBenchmarkBenchmarkPrivate {
277 	GType g_type;
278 	GBoxedCopyFunc g_dup_func;
279 	GDestroyNotify g_destroy_func;
280 	GeeBenchmarkFactory* factory;
281 	gint* sizes;
282 	gint sizes_length1;
283 	gint _sizes_size_;
284 	GeeList* generators;
285 	GeeList* algorithms;
286 	gint iteration_count;
287 	gdouble* results_sum;
288 	gint results_sum_length1;
289 	gint results_sum_length2;
290 	gint results_sum_length3;
291 	gdouble* results_squared_sum;
292 	gint results_squared_sum_length1;
293 	gint results_squared_sum_length2;
294 	gint results_squared_sum_length3;
295 };
296 
297 static gpointer gee_benchmark_random_int32_parent_class = NULL;
298 static GeeBenchmarkGeneratorIface * gee_benchmark_random_int32_gee_benchmark_generator_parent_iface = NULL;
299 static gpointer gee_benchmark_fixed_variance_int32_parent_class = NULL;
300 static GeeBenchmarkGeneratorIface * gee_benchmark_fixed_variance_int32_gee_benchmark_generator_parent_iface = NULL;
301 static gpointer gee_benchmark_mounts_int32_parent_class = NULL;
302 static GeeBenchmarkGeneratorIface * gee_benchmark_mounts_int32_gee_benchmark_generator_parent_iface = NULL;
303 static gpointer gee_benchmark_reverse_sorted_int32_parent_class = NULL;
304 static GeeBenchmarkGeneratorIface * gee_benchmark_reverse_sorted_int32_gee_benchmark_generator_parent_iface = NULL;
305 static gpointer gee_benchmark_sorted_int32_parent_class = NULL;
306 static GeeBenchmarkGeneratorIface * gee_benchmark_sorted_int32_gee_benchmark_generator_parent_iface = NULL;
307 static gint GeeBenchmarkArrayListFactory_private_offset;
308 static gpointer gee_benchmark_array_list_factory_parent_class = NULL;
309 static GeeBenchmarkFactoryIface * gee_benchmark_array_list_factory_gee_benchmark_factory_parent_iface = NULL;
310 static gint GeeBenchmarkBenchmark_private_offset;
311 static gpointer gee_benchmark_benchmark_parent_class = NULL;
312 
313 G_GNUC_INTERNAL void gee_benchmark_run_benchmark_option (const gchar* long_name,
314                                          gchar short_name,
315                                          const gchar* description,
316                                          gboolean* do_run,
317                                          GOptionEntry* result);
318 G_GNUC_INTERNAL gint gee_benchmark_main (gchar** args,
319                          gint args_length1);
320 void gee_benchmark_benchmark_sorts (void);
321 GType gee_benchmark_factory_get_type (void) G_GNUC_CONST;
322 GeeCollection* gee_benchmark_factory_create (GeeBenchmarkFactory* self);
323 GeeCollection* gee_benchmark_factory_copy (GeeBenchmarkFactory* self,
324                                            GeeCollection* collection);
325 GType gee_benchmark_generator_get_type (void) G_GNUC_CONST;
326 void gee_benchmark_generator_generate_collection (GeeBenchmarkGenerator* self,
327                                                   gint size,
328                                                   GeeCollection* collection);
329 const gchar* gee_benchmark_generator_get_name (GeeBenchmarkGenerator* self);
330 GType gee_benchmark_algorithm_get_type (void) G_GNUC_CONST;
331 void gee_benchmark_algorithm_process_collection (GeeBenchmarkAlgorithm* self,
332                                                  GeeCollection* collection);
333 const gchar* gee_benchmark_algorithm_get_name (GeeBenchmarkAlgorithm* self);
334 GType gee_benchmark_random_int32_get_type (void) G_GNUC_CONST;
335 G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeBenchmarkRandomInt32, g_object_unref)
336 static void gee_benchmark_random_int32_real_generate_collection (GeeBenchmarkGenerator* base,
337                                                           gint size,
338                                                           GeeCollection* collection);
339 GeeBenchmarkRandomInt32* gee_benchmark_random_int32_new (void);
340 GeeBenchmarkRandomInt32* gee_benchmark_random_int32_construct (GType object_type);
341 static void _vala_gee_benchmark_random_int32_get_property (GObject * object,
342                                                     guint property_id,
343                                                     GValue * value,
344                                                     GParamSpec * pspec);
345 GType gee_benchmark_fixed_variance_int32_get_type (void) G_GNUC_CONST;
346 G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeBenchmarkFixedVarianceInt32, g_object_unref)
347 static void gee_benchmark_fixed_variance_int32_real_generate_collection (GeeBenchmarkGenerator* base,
348                                                                   gint size,
349                                                                   GeeCollection* collection);
350 GeeBenchmarkFixedVarianceInt32* gee_benchmark_fixed_variance_int32_new (void);
351 GeeBenchmarkFixedVarianceInt32* gee_benchmark_fixed_variance_int32_construct (GType object_type);
352 static void _vala_gee_benchmark_fixed_variance_int32_get_property (GObject * object,
353                                                             guint property_id,
354                                                             GValue * value,
355                                                             GParamSpec * pspec);
356 GType gee_benchmark_mounts_int32_get_type (void) G_GNUC_CONST;
357 G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeBenchmarkMountsInt32, g_object_unref)
358 static void gee_benchmark_mounts_int32_real_generate_collection (GeeBenchmarkGenerator* base,
359                                                           gint size,
360                                                           GeeCollection* collection);
361 GeeBenchmarkMountsInt32* gee_benchmark_mounts_int32_new (void);
362 GeeBenchmarkMountsInt32* gee_benchmark_mounts_int32_construct (GType object_type);
363 static void _vala_gee_benchmark_mounts_int32_get_property (GObject * object,
364                                                     guint property_id,
365                                                     GValue * value,
366                                                     GParamSpec * pspec);
367 GType gee_benchmark_reverse_sorted_int32_get_type (void) G_GNUC_CONST;
368 G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeBenchmarkReverseSortedInt32, g_object_unref)
369 static void gee_benchmark_reverse_sorted_int32_real_generate_collection (GeeBenchmarkGenerator* base,
370                                                                   gint size,
371                                                                   GeeCollection* collection);
372 GeeBenchmarkReverseSortedInt32* gee_benchmark_reverse_sorted_int32_new (void);
373 GeeBenchmarkReverseSortedInt32* gee_benchmark_reverse_sorted_int32_construct (GType object_type);
374 static void _vala_gee_benchmark_reverse_sorted_int32_get_property (GObject * object,
375                                                             guint property_id,
376                                                             GValue * value,
377                                                             GParamSpec * pspec);
378 GType gee_benchmark_sorted_int32_get_type (void) G_GNUC_CONST;
379 G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeBenchmarkSortedInt32, g_object_unref)
380 static void gee_benchmark_sorted_int32_real_generate_collection (GeeBenchmarkGenerator* base,
381                                                           gint size,
382                                                           GeeCollection* collection);
383 GeeBenchmarkSortedInt32* gee_benchmark_sorted_int32_new (void);
384 GeeBenchmarkSortedInt32* gee_benchmark_sorted_int32_construct (GType object_type);
385 static void _vala_gee_benchmark_sorted_int32_get_property (GObject * object,
386                                                     guint property_id,
387                                                     GValue * value,
388                                                     GParamSpec * pspec);
389 GType gee_benchmark_array_list_factory_get_type (void) G_GNUC_CONST;
390 G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeBenchmarkArrayListFactory, g_object_unref)
391 static GeeCollection* gee_benchmark_array_list_factory_real_create (GeeBenchmarkFactory* base);
392 static GeeCollection* gee_benchmark_array_list_factory_real_copy (GeeBenchmarkFactory* base,
393                                                            GeeCollection* collection);
394 GeeBenchmarkArrayListFactory* gee_benchmark_array_list_factory_new (GType g_type,
395                                                                     GBoxedCopyFunc g_dup_func,
396                                                                     GDestroyNotify g_destroy_func);
397 GeeBenchmarkArrayListFactory* gee_benchmark_array_list_factory_construct (GType object_type,
398                                                                           GType g_type,
399                                                                           GBoxedCopyFunc g_dup_func,
400                                                                           GDestroyNotify g_destroy_func);
401 static void _vala_gee_benchmark_array_list_factory_get_property (GObject * object,
402                                                           guint property_id,
403                                                           GValue * value,
404                                                           GParamSpec * pspec);
405 static void _vala_gee_benchmark_array_list_factory_set_property (GObject * object,
406                                                           guint property_id,
407                                                           const GValue * value,
408                                                           GParamSpec * pspec);
409 GType gee_benchmark_benchmark_get_type (void) G_GNUC_CONST;
410 G_DEFINE_AUTOPTR_CLEANUP_FUNC (GeeBenchmarkBenchmark, g_object_unref)
411 GeeBenchmarkBenchmark* gee_benchmark_benchmark_new (GType g_type,
412                                                     GBoxedCopyFunc g_dup_func,
413                                                     GDestroyNotify g_destroy_func,
414                                                     GeeBenchmarkFactory* factory,
415                                                     GeeList* algorithms,
416                                                     GeeList* generators,
417                                                     gint* sizes,
418                                                     gint sizes_length1,
419                                                     gint iteration_count);
420 GeeBenchmarkBenchmark* gee_benchmark_benchmark_construct (GType object_type,
421                                                           GType g_type,
422                                                           GBoxedCopyFunc g_dup_func,
423                                                           GDestroyNotify g_destroy_func,
424                                                           GeeBenchmarkFactory* factory,
425                                                           GeeList* algorithms,
426                                                           GeeList* generators,
427                                                           gint* sizes,
428                                                           gint sizes_length1,
429                                                           gint iteration_count);
430 static gint* _vala_array_dup1 (gint* self,
431                         int length);
432 void gee_benchmark_benchmark_run (GeeBenchmarkBenchmark* self);
433 void gee_benchmark_benchmark_display_results (GeeBenchmarkBenchmark* self,
434                                               gint iteration);
435 static void gee_benchmark_benchmark_finalize (GObject * obj);
436 static void _vala_gee_benchmark_benchmark_get_property (GObject * object,
437                                                  guint property_id,
438                                                  GValue * value,
439                                                  GParamSpec * pspec);
440 static void _vala_gee_benchmark_benchmark_set_property (GObject * object,
441                                                  guint property_id,
442                                                  const GValue * value,
443                                                  GParamSpec * pspec);
444 
445 G_GNUC_INTERNAL void
gee_benchmark_run_benchmark_option(const gchar * long_name,gchar short_name,const gchar * description,gboolean * do_run,GOptionEntry * result)446 gee_benchmark_run_benchmark_option (const gchar* long_name,
447                                     gchar short_name,
448                                     const gchar* description,
449                                     gboolean* do_run,
450                                     GOptionEntry* result)
451 {
452 	GOptionEntry _tmp0_ = {0};
453 	g_return_if_fail (long_name != NULL);
454 	g_return_if_fail (description != NULL);
455 	memset (&_tmp0_, 0, sizeof (GOptionEntry));
456 	_tmp0_.long_name = long_name;
457 	_tmp0_.short_name = short_name;
458 	_tmp0_.flags = 0;
459 	_tmp0_.arg = G_OPTION_ARG_NONE;
460 	_tmp0_.arg_data = do_run;
461 	_tmp0_.description = description;
462 	_tmp0_.arg_description = NULL;
463 	*result = _tmp0_;
464 	return;
465 }
466 
467 G_GNUC_INTERNAL gint
gee_benchmark_main(gchar ** args,gint args_length1)468 gee_benchmark_main (gchar** args,
469                     gint args_length1)
470 {
471 	gboolean run_sort = FALSE;
472 	GOptionEntry* entries = NULL;
473 	GOptionEntry _tmp0_ = {0};
474 	GOptionEntry* _tmp1_;
475 	gint entries_length1;
476 	gint _entries_size_;
477 	GOptionContext* context = NULL;
478 	GOptionContext* _tmp2_;
479 	GOptionContext* _tmp3_;
480 	GOptionEntry* _tmp4_;
481 	gint _tmp4__length1;
482 	GError* _inner_error0_ = NULL;
483 	gint result = 0;
484 	run_sort = FALSE;
485 	gee_benchmark_run_benchmark_option ("run-sort", 's', "Run sorting benchmark", &run_sort, &_tmp0_);
486 	_tmp1_ = g_new0 (GOptionEntry, 1);
487 	_tmp1_[0] = _tmp0_;
488 	entries = _tmp1_;
489 	entries_length1 = 1;
490 	_entries_size_ = entries_length1;
491 	_tmp2_ = g_option_context_new ("Run various benchmarks");
492 	context = _tmp2_;
493 	_tmp3_ = context;
494 	_tmp4_ = entries;
495 	_tmp4__length1 = entries_length1;
496 	g_option_context_add_main_entries (_tmp3_, _tmp4_, "gee-benchmark");
497 	{
498 		GOptionContext* _tmp5_;
499 		_tmp5_ = context;
500 		g_option_context_parse (_tmp5_, (gint*) (&args_length1), &args, &_inner_error0_);
501 		if (G_UNLIKELY (_inner_error0_ != NULL)) {
502 			gint _tmp6_ = -1;
503 			if (_inner_error0_->domain == G_OPTION_ERROR) {
504 				goto __catch0_g_option_error;
505 			}
506 			_g_option_context_free0 (context);
507 			entries = (g_free (entries), NULL);
508 			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
509 			g_clear_error (&_inner_error0_);
510 			return _tmp6_;
511 		}
512 	}
513 	goto __finally0;
514 	__catch0_g_option_error:
515 	{
516 		GError* e = NULL;
517 		FILE* _tmp7_;
518 		GError* _tmp8_;
519 		const gchar* _tmp9_;
520 		e = _inner_error0_;
521 		_inner_error0_ = NULL;
522 		_tmp7_ = stdout;
523 		_tmp8_ = e;
524 		_tmp9_ = _tmp8_->message;
525 		fprintf (_tmp7_, "option parsing failed: %s\n", _tmp9_);
526 		result = 2;
527 		_g_error_free0 (e);
528 		_g_option_context_free0 (context);
529 		entries = (g_free (entries), NULL);
530 		return result;
531 	}
532 	__finally0:
533 	if (G_UNLIKELY (_inner_error0_ != NULL)) {
534 		gint _tmp10_ = -1;
535 		_g_option_context_free0 (context);
536 		entries = (g_free (entries), NULL);
537 		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
538 		g_clear_error (&_inner_error0_);
539 		return _tmp10_;
540 	}
541 	if (run_sort) {
542 		gee_benchmark_benchmark_sorts ();
543 	}
544 	result = 0;
545 	_g_option_context_free0 (context);
546 	entries = (g_free (entries), NULL);
547 	return result;
548 }
549 
550 int
main(int argc,char ** argv)551 main (int argc,
552       char ** argv)
553 {
554 	return gee_benchmark_main (argv, argc);
555 }
556 
557 GeeCollection*
gee_benchmark_factory_create(GeeBenchmarkFactory * self)558 gee_benchmark_factory_create (GeeBenchmarkFactory* self)
559 {
560 	g_return_val_if_fail (self != NULL, NULL);
561 	return GEE_BENCHMARK_FACTORY_GET_INTERFACE (self)->create (self);
562 }
563 
564 GeeCollection*
gee_benchmark_factory_copy(GeeBenchmarkFactory * self,GeeCollection * collection)565 gee_benchmark_factory_copy (GeeBenchmarkFactory* self,
566                             GeeCollection* collection)
567 {
568 	g_return_val_if_fail (self != NULL, NULL);
569 	return GEE_BENCHMARK_FACTORY_GET_INTERFACE (self)->copy (self, collection);
570 }
571 
572 static void
gee_benchmark_factory_default_init(GeeBenchmarkFactoryIface * iface,gpointer iface_data)573 gee_benchmark_factory_default_init (GeeBenchmarkFactoryIface * iface,
574                                     gpointer iface_data)
575 {
576 }
577 
578 GType
gee_benchmark_factory_get_type(void)579 gee_benchmark_factory_get_type (void)
580 {
581 	static volatile gsize gee_benchmark_factory_type_id__volatile = 0;
582 	if (g_once_init_enter (&gee_benchmark_factory_type_id__volatile)) {
583 		static const GTypeInfo g_define_type_info = { sizeof (GeeBenchmarkFactoryIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_benchmark_factory_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
584 		GType gee_benchmark_factory_type_id;
585 		gee_benchmark_factory_type_id = g_type_register_static (G_TYPE_INTERFACE, "GeeBenchmarkFactory", &g_define_type_info, 0);
586 		g_type_interface_add_prerequisite (gee_benchmark_factory_type_id, G_TYPE_OBJECT);
587 		g_once_init_leave (&gee_benchmark_factory_type_id__volatile, gee_benchmark_factory_type_id);
588 	}
589 	return gee_benchmark_factory_type_id__volatile;
590 }
591 
592 void
gee_benchmark_generator_generate_collection(GeeBenchmarkGenerator * self,gint size,GeeCollection * collection)593 gee_benchmark_generator_generate_collection (GeeBenchmarkGenerator* self,
594                                              gint size,
595                                              GeeCollection* collection)
596 {
597 	g_return_if_fail (self != NULL);
598 	GEE_BENCHMARK_GENERATOR_GET_INTERFACE (self)->generate_collection (self, size, collection);
599 }
600 
601 const gchar*
gee_benchmark_generator_get_name(GeeBenchmarkGenerator * self)602 gee_benchmark_generator_get_name (GeeBenchmarkGenerator* self)
603 {
604 	g_return_val_if_fail (self != NULL, NULL);
605 	return GEE_BENCHMARK_GENERATOR_GET_INTERFACE (self)->get_name (self);
606 }
607 
608 static void
gee_benchmark_generator_default_init(GeeBenchmarkGeneratorIface * iface,gpointer iface_data)609 gee_benchmark_generator_default_init (GeeBenchmarkGeneratorIface * iface,
610                                       gpointer iface_data)
611 {
612 	g_object_interface_install_property (iface, g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
613 }
614 
615 GType
gee_benchmark_generator_get_type(void)616 gee_benchmark_generator_get_type (void)
617 {
618 	static volatile gsize gee_benchmark_generator_type_id__volatile = 0;
619 	if (g_once_init_enter (&gee_benchmark_generator_type_id__volatile)) {
620 		static const GTypeInfo g_define_type_info = { sizeof (GeeBenchmarkGeneratorIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_benchmark_generator_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
621 		GType gee_benchmark_generator_type_id;
622 		gee_benchmark_generator_type_id = g_type_register_static (G_TYPE_INTERFACE, "GeeBenchmarkGenerator", &g_define_type_info, 0);
623 		g_type_interface_add_prerequisite (gee_benchmark_generator_type_id, G_TYPE_OBJECT);
624 		g_once_init_leave (&gee_benchmark_generator_type_id__volatile, gee_benchmark_generator_type_id);
625 	}
626 	return gee_benchmark_generator_type_id__volatile;
627 }
628 
629 void
gee_benchmark_algorithm_process_collection(GeeBenchmarkAlgorithm * self,GeeCollection * collection)630 gee_benchmark_algorithm_process_collection (GeeBenchmarkAlgorithm* self,
631                                             GeeCollection* collection)
632 {
633 	g_return_if_fail (self != NULL);
634 	GEE_BENCHMARK_ALGORITHM_GET_INTERFACE (self)->process_collection (self, collection);
635 }
636 
637 const gchar*
gee_benchmark_algorithm_get_name(GeeBenchmarkAlgorithm * self)638 gee_benchmark_algorithm_get_name (GeeBenchmarkAlgorithm* self)
639 {
640 	g_return_val_if_fail (self != NULL, NULL);
641 	return GEE_BENCHMARK_ALGORITHM_GET_INTERFACE (self)->get_name (self);
642 }
643 
644 static void
gee_benchmark_algorithm_default_init(GeeBenchmarkAlgorithmIface * iface,gpointer iface_data)645 gee_benchmark_algorithm_default_init (GeeBenchmarkAlgorithmIface * iface,
646                                       gpointer iface_data)
647 {
648 	g_object_interface_install_property (iface, g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
649 }
650 
651 GType
gee_benchmark_algorithm_get_type(void)652 gee_benchmark_algorithm_get_type (void)
653 {
654 	static volatile gsize gee_benchmark_algorithm_type_id__volatile = 0;
655 	if (g_once_init_enter (&gee_benchmark_algorithm_type_id__volatile)) {
656 		static const GTypeInfo g_define_type_info = { sizeof (GeeBenchmarkAlgorithmIface), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_benchmark_algorithm_default_init, (GClassFinalizeFunc) NULL, NULL, 0, 0, (GInstanceInitFunc) NULL, NULL };
657 		GType gee_benchmark_algorithm_type_id;
658 		gee_benchmark_algorithm_type_id = g_type_register_static (G_TYPE_INTERFACE, "GeeBenchmarkAlgorithm", &g_define_type_info, 0);
659 		g_type_interface_add_prerequisite (gee_benchmark_algorithm_type_id, G_TYPE_OBJECT);
660 		g_once_init_leave (&gee_benchmark_algorithm_type_id__volatile, gee_benchmark_algorithm_type_id);
661 	}
662 	return gee_benchmark_algorithm_type_id__volatile;
663 }
664 
665 static void
gee_benchmark_random_int32_real_generate_collection(GeeBenchmarkGenerator * base,gint size,GeeCollection * collection)666 gee_benchmark_random_int32_real_generate_collection (GeeBenchmarkGenerator* base,
667                                                      gint size,
668                                                      GeeCollection* collection)
669 {
670 	GeeBenchmarkRandomInt32 * self;
671 	self = (GeeBenchmarkRandomInt32*) base;
672 	g_return_if_fail (collection != NULL);
673 	{
674 		gint i = 0;
675 		i = 0;
676 		{
677 			gboolean _tmp0_ = FALSE;
678 			_tmp0_ = TRUE;
679 			while (TRUE) {
680 				if (!_tmp0_) {
681 					gint _tmp1_;
682 					_tmp1_ = i;
683 					i = _tmp1_ + 1;
684 				}
685 				_tmp0_ = FALSE;
686 				if (!(i < size)) {
687 					break;
688 				}
689 				gee_collection_add (collection, (gpointer) ((gintptr) g_random_int_range ((gint32) 0, (gint32) (size - 1))));
690 			}
691 		}
692 	}
693 }
694 
695 GeeBenchmarkRandomInt32*
gee_benchmark_random_int32_construct(GType object_type)696 gee_benchmark_random_int32_construct (GType object_type)
697 {
698 	GeeBenchmarkRandomInt32 * self = NULL;
699 	self = (GeeBenchmarkRandomInt32*) g_object_new (object_type, NULL);
700 	return self;
701 }
702 
703 GeeBenchmarkRandomInt32*
gee_benchmark_random_int32_new(void)704 gee_benchmark_random_int32_new (void)
705 {
706 	return gee_benchmark_random_int32_construct (GEE_BENCHMARK_TYPE_RANDOM_INT32);
707 }
708 
709 static const gchar*
gee_benchmark_random_int32_real_get_name(GeeBenchmarkGenerator * base)710 gee_benchmark_random_int32_real_get_name (GeeBenchmarkGenerator* base)
711 {
712 	const gchar* result;
713 	GeeBenchmarkRandomInt32* self;
714 	self = (GeeBenchmarkRandomInt32*) base;
715 	result = "FullRandom";
716 	return result;
717 }
718 
719 static void
gee_benchmark_random_int32_class_init(GeeBenchmarkRandomInt32Class * klass,gpointer klass_data)720 gee_benchmark_random_int32_class_init (GeeBenchmarkRandomInt32Class * klass,
721                                        gpointer klass_data)
722 {
723 	gee_benchmark_random_int32_parent_class = g_type_class_peek_parent (klass);
724 	G_OBJECT_CLASS (klass)->get_property = _vala_gee_benchmark_random_int32_get_property;
725 	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_BENCHMARK_RANDOM_INT32_NAME_PROPERTY, gee_benchmark_random_int32_properties[GEE_BENCHMARK_RANDOM_INT32_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
726 }
727 
728 static void
gee_benchmark_random_int32_gee_benchmark_generator_interface_init(GeeBenchmarkGeneratorIface * iface,gpointer iface_data)729 gee_benchmark_random_int32_gee_benchmark_generator_interface_init (GeeBenchmarkGeneratorIface * iface,
730                                                                    gpointer iface_data)
731 {
732 	gee_benchmark_random_int32_gee_benchmark_generator_parent_iface = g_type_interface_peek_parent (iface);
733 	iface->generate_collection = (void (*) (GeeBenchmarkGenerator*, gint, GeeCollection*)) gee_benchmark_random_int32_real_generate_collection;
734 	iface->get_name = gee_benchmark_random_int32_real_get_name;
735 }
736 
737 static void
gee_benchmark_random_int32_instance_init(GeeBenchmarkRandomInt32 * self,gpointer klass)738 gee_benchmark_random_int32_instance_init (GeeBenchmarkRandomInt32 * self,
739                                           gpointer klass)
740 {
741 }
742 
743 GType
gee_benchmark_random_int32_get_type(void)744 gee_benchmark_random_int32_get_type (void)
745 {
746 	static volatile gsize gee_benchmark_random_int32_type_id__volatile = 0;
747 	if (g_once_init_enter (&gee_benchmark_random_int32_type_id__volatile)) {
748 		static const GTypeInfo g_define_type_info = { sizeof (GeeBenchmarkRandomInt32Class), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_benchmark_random_int32_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeBenchmarkRandomInt32), 0, (GInstanceInitFunc) gee_benchmark_random_int32_instance_init, NULL };
749 		static const GInterfaceInfo gee_benchmark_generator_info = { (GInterfaceInitFunc) gee_benchmark_random_int32_gee_benchmark_generator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
750 		GType gee_benchmark_random_int32_type_id;
751 		gee_benchmark_random_int32_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeBenchmarkRandomInt32", &g_define_type_info, 0);
752 		g_type_add_interface_static (gee_benchmark_random_int32_type_id, GEE_BENCHMARK_TYPE_GENERATOR, &gee_benchmark_generator_info);
753 		g_once_init_leave (&gee_benchmark_random_int32_type_id__volatile, gee_benchmark_random_int32_type_id);
754 	}
755 	return gee_benchmark_random_int32_type_id__volatile;
756 }
757 
758 static void
_vala_gee_benchmark_random_int32_get_property(GObject * object,guint property_id,GValue * value,GParamSpec * pspec)759 _vala_gee_benchmark_random_int32_get_property (GObject * object,
760                                                guint property_id,
761                                                GValue * value,
762                                                GParamSpec * pspec)
763 {
764 	GeeBenchmarkRandomInt32 * self;
765 	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_BENCHMARK_TYPE_RANDOM_INT32, GeeBenchmarkRandomInt32);
766 	switch (property_id) {
767 		case GEE_BENCHMARK_RANDOM_INT32_NAME_PROPERTY:
768 		g_value_set_string (value, gee_benchmark_generator_get_name ((GeeBenchmarkGenerator*) self));
769 		break;
770 		default:
771 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
772 		break;
773 	}
774 }
775 
776 static void
gee_benchmark_fixed_variance_int32_real_generate_collection(GeeBenchmarkGenerator * base,gint size,GeeCollection * collection)777 gee_benchmark_fixed_variance_int32_real_generate_collection (GeeBenchmarkGenerator* base,
778                                                              gint size,
779                                                              GeeCollection* collection)
780 {
781 	GeeBenchmarkFixedVarianceInt32 * self;
782 	gint variance = 0;
783 	self = (GeeBenchmarkFixedVarianceInt32*) base;
784 	g_return_if_fail (collection != NULL);
785 	variance = (gint) sqrt ((gdouble) size);
786 	{
787 		gint i = 0;
788 		i = 0;
789 		{
790 			gboolean _tmp0_ = FALSE;
791 			_tmp0_ = TRUE;
792 			while (TRUE) {
793 				if (!_tmp0_) {
794 					gint _tmp1_;
795 					_tmp1_ = i;
796 					i = _tmp1_ + 1;
797 				}
798 				_tmp0_ = FALSE;
799 				if (!(i < size)) {
800 					break;
801 				}
802 				gee_collection_add (collection, (gpointer) ((gintptr) ((gint32) ((i + g_random_int_range ((gint32) 0, (gint32) variance)) - (variance / 2)))));
803 			}
804 		}
805 	}
806 }
807 
808 GeeBenchmarkFixedVarianceInt32*
gee_benchmark_fixed_variance_int32_construct(GType object_type)809 gee_benchmark_fixed_variance_int32_construct (GType object_type)
810 {
811 	GeeBenchmarkFixedVarianceInt32 * self = NULL;
812 	self = (GeeBenchmarkFixedVarianceInt32*) g_object_new (object_type, NULL);
813 	return self;
814 }
815 
816 GeeBenchmarkFixedVarianceInt32*
gee_benchmark_fixed_variance_int32_new(void)817 gee_benchmark_fixed_variance_int32_new (void)
818 {
819 	return gee_benchmark_fixed_variance_int32_construct (GEE_BENCHMARK_TYPE_FIXED_VARIANCE_INT32);
820 }
821 
822 static const gchar*
gee_benchmark_fixed_variance_int32_real_get_name(GeeBenchmarkGenerator * base)823 gee_benchmark_fixed_variance_int32_real_get_name (GeeBenchmarkGenerator* base)
824 {
825 	const gchar* result;
826 	GeeBenchmarkFixedVarianceInt32* self;
827 	self = (GeeBenchmarkFixedVarianceInt32*) base;
828 	result = "FixedVariance";
829 	return result;
830 }
831 
832 static void
gee_benchmark_fixed_variance_int32_class_init(GeeBenchmarkFixedVarianceInt32Class * klass,gpointer klass_data)833 gee_benchmark_fixed_variance_int32_class_init (GeeBenchmarkFixedVarianceInt32Class * klass,
834                                                gpointer klass_data)
835 {
836 	gee_benchmark_fixed_variance_int32_parent_class = g_type_class_peek_parent (klass);
837 	G_OBJECT_CLASS (klass)->get_property = _vala_gee_benchmark_fixed_variance_int32_get_property;
838 	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_BENCHMARK_FIXED_VARIANCE_INT32_NAME_PROPERTY, gee_benchmark_fixed_variance_int32_properties[GEE_BENCHMARK_FIXED_VARIANCE_INT32_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
839 }
840 
841 static void
gee_benchmark_fixed_variance_int32_gee_benchmark_generator_interface_init(GeeBenchmarkGeneratorIface * iface,gpointer iface_data)842 gee_benchmark_fixed_variance_int32_gee_benchmark_generator_interface_init (GeeBenchmarkGeneratorIface * iface,
843                                                                            gpointer iface_data)
844 {
845 	gee_benchmark_fixed_variance_int32_gee_benchmark_generator_parent_iface = g_type_interface_peek_parent (iface);
846 	iface->generate_collection = (void (*) (GeeBenchmarkGenerator*, gint, GeeCollection*)) gee_benchmark_fixed_variance_int32_real_generate_collection;
847 	iface->get_name = gee_benchmark_fixed_variance_int32_real_get_name;
848 }
849 
850 static void
gee_benchmark_fixed_variance_int32_instance_init(GeeBenchmarkFixedVarianceInt32 * self,gpointer klass)851 gee_benchmark_fixed_variance_int32_instance_init (GeeBenchmarkFixedVarianceInt32 * self,
852                                                   gpointer klass)
853 {
854 }
855 
856 GType
gee_benchmark_fixed_variance_int32_get_type(void)857 gee_benchmark_fixed_variance_int32_get_type (void)
858 {
859 	static volatile gsize gee_benchmark_fixed_variance_int32_type_id__volatile = 0;
860 	if (g_once_init_enter (&gee_benchmark_fixed_variance_int32_type_id__volatile)) {
861 		static const GTypeInfo g_define_type_info = { sizeof (GeeBenchmarkFixedVarianceInt32Class), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_benchmark_fixed_variance_int32_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeBenchmarkFixedVarianceInt32), 0, (GInstanceInitFunc) gee_benchmark_fixed_variance_int32_instance_init, NULL };
862 		static const GInterfaceInfo gee_benchmark_generator_info = { (GInterfaceInitFunc) gee_benchmark_fixed_variance_int32_gee_benchmark_generator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
863 		GType gee_benchmark_fixed_variance_int32_type_id;
864 		gee_benchmark_fixed_variance_int32_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeBenchmarkFixedVarianceInt32", &g_define_type_info, 0);
865 		g_type_add_interface_static (gee_benchmark_fixed_variance_int32_type_id, GEE_BENCHMARK_TYPE_GENERATOR, &gee_benchmark_generator_info);
866 		g_once_init_leave (&gee_benchmark_fixed_variance_int32_type_id__volatile, gee_benchmark_fixed_variance_int32_type_id);
867 	}
868 	return gee_benchmark_fixed_variance_int32_type_id__volatile;
869 }
870 
871 static void
_vala_gee_benchmark_fixed_variance_int32_get_property(GObject * object,guint property_id,GValue * value,GParamSpec * pspec)872 _vala_gee_benchmark_fixed_variance_int32_get_property (GObject * object,
873                                                        guint property_id,
874                                                        GValue * value,
875                                                        GParamSpec * pspec)
876 {
877 	GeeBenchmarkFixedVarianceInt32 * self;
878 	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_BENCHMARK_TYPE_FIXED_VARIANCE_INT32, GeeBenchmarkFixedVarianceInt32);
879 	switch (property_id) {
880 		case GEE_BENCHMARK_FIXED_VARIANCE_INT32_NAME_PROPERTY:
881 		g_value_set_string (value, gee_benchmark_generator_get_name ((GeeBenchmarkGenerator*) self));
882 		break;
883 		default:
884 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
885 		break;
886 	}
887 }
888 
889 static void
gee_benchmark_mounts_int32_real_generate_collection(GeeBenchmarkGenerator * base,gint size,GeeCollection * collection)890 gee_benchmark_mounts_int32_real_generate_collection (GeeBenchmarkGenerator* base,
891                                                      gint size,
892                                                      GeeCollection* collection)
893 {
894 	GeeBenchmarkMountsInt32 * self;
895 	gint index = 0;
896 	gint last = 0;
897 	gint variance = 0;
898 	self = (GeeBenchmarkMountsInt32*) base;
899 	g_return_if_fail (collection != NULL);
900 	index = 0;
901 	last = 0;
902 	variance = (gint) sqrt ((gdouble) size);
903 	while (TRUE) {
904 		gint width = 0;
905 		gint height = 0;
906 		if (!(index < size)) {
907 			break;
908 		}
909 		width = (gint) g_random_int_range ((gint32) 0, (gint32) variance);
910 		height = (gint) g_random_int_range ((gint32) ((-variance) / 2), (gint32) (variance / 2));
911 		{
912 			gint i = 0;
913 			i = 0;
914 			{
915 				gboolean _tmp0_ = FALSE;
916 				_tmp0_ = TRUE;
917 				while (TRUE) {
918 					if (!_tmp0_) {
919 						gint _tmp1_;
920 						_tmp1_ = i;
921 						i = _tmp1_ + 1;
922 					}
923 					_tmp0_ = FALSE;
924 					if (!(i < width)) {
925 						break;
926 					}
927 					gee_collection_add (collection, (gpointer) ((gintptr) ((gint32) (last + (height / width)))));
928 				}
929 			}
930 		}
931 		index += width;
932 		last += height;
933 	}
934 }
935 
936 GeeBenchmarkMountsInt32*
gee_benchmark_mounts_int32_construct(GType object_type)937 gee_benchmark_mounts_int32_construct (GType object_type)
938 {
939 	GeeBenchmarkMountsInt32 * self = NULL;
940 	self = (GeeBenchmarkMountsInt32*) g_object_new (object_type, NULL);
941 	return self;
942 }
943 
944 GeeBenchmarkMountsInt32*
gee_benchmark_mounts_int32_new(void)945 gee_benchmark_mounts_int32_new (void)
946 {
947 	return gee_benchmark_mounts_int32_construct (GEE_BENCHMARK_TYPE_MOUNTS_INT32);
948 }
949 
950 static const gchar*
gee_benchmark_mounts_int32_real_get_name(GeeBenchmarkGenerator * base)951 gee_benchmark_mounts_int32_real_get_name (GeeBenchmarkGenerator* base)
952 {
953 	const gchar* result;
954 	GeeBenchmarkMountsInt32* self;
955 	self = (GeeBenchmarkMountsInt32*) base;
956 	result = "Mounts";
957 	return result;
958 }
959 
960 static void
gee_benchmark_mounts_int32_class_init(GeeBenchmarkMountsInt32Class * klass,gpointer klass_data)961 gee_benchmark_mounts_int32_class_init (GeeBenchmarkMountsInt32Class * klass,
962                                        gpointer klass_data)
963 {
964 	gee_benchmark_mounts_int32_parent_class = g_type_class_peek_parent (klass);
965 	G_OBJECT_CLASS (klass)->get_property = _vala_gee_benchmark_mounts_int32_get_property;
966 	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_BENCHMARK_MOUNTS_INT32_NAME_PROPERTY, gee_benchmark_mounts_int32_properties[GEE_BENCHMARK_MOUNTS_INT32_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
967 }
968 
969 static void
gee_benchmark_mounts_int32_gee_benchmark_generator_interface_init(GeeBenchmarkGeneratorIface * iface,gpointer iface_data)970 gee_benchmark_mounts_int32_gee_benchmark_generator_interface_init (GeeBenchmarkGeneratorIface * iface,
971                                                                    gpointer iface_data)
972 {
973 	gee_benchmark_mounts_int32_gee_benchmark_generator_parent_iface = g_type_interface_peek_parent (iface);
974 	iface->generate_collection = (void (*) (GeeBenchmarkGenerator*, gint, GeeCollection*)) gee_benchmark_mounts_int32_real_generate_collection;
975 	iface->get_name = gee_benchmark_mounts_int32_real_get_name;
976 }
977 
978 static void
gee_benchmark_mounts_int32_instance_init(GeeBenchmarkMountsInt32 * self,gpointer klass)979 gee_benchmark_mounts_int32_instance_init (GeeBenchmarkMountsInt32 * self,
980                                           gpointer klass)
981 {
982 }
983 
984 GType
gee_benchmark_mounts_int32_get_type(void)985 gee_benchmark_mounts_int32_get_type (void)
986 {
987 	static volatile gsize gee_benchmark_mounts_int32_type_id__volatile = 0;
988 	if (g_once_init_enter (&gee_benchmark_mounts_int32_type_id__volatile)) {
989 		static const GTypeInfo g_define_type_info = { sizeof (GeeBenchmarkMountsInt32Class), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_benchmark_mounts_int32_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeBenchmarkMountsInt32), 0, (GInstanceInitFunc) gee_benchmark_mounts_int32_instance_init, NULL };
990 		static const GInterfaceInfo gee_benchmark_generator_info = { (GInterfaceInitFunc) gee_benchmark_mounts_int32_gee_benchmark_generator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
991 		GType gee_benchmark_mounts_int32_type_id;
992 		gee_benchmark_mounts_int32_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeBenchmarkMountsInt32", &g_define_type_info, 0);
993 		g_type_add_interface_static (gee_benchmark_mounts_int32_type_id, GEE_BENCHMARK_TYPE_GENERATOR, &gee_benchmark_generator_info);
994 		g_once_init_leave (&gee_benchmark_mounts_int32_type_id__volatile, gee_benchmark_mounts_int32_type_id);
995 	}
996 	return gee_benchmark_mounts_int32_type_id__volatile;
997 }
998 
999 static void
_vala_gee_benchmark_mounts_int32_get_property(GObject * object,guint property_id,GValue * value,GParamSpec * pspec)1000 _vala_gee_benchmark_mounts_int32_get_property (GObject * object,
1001                                                guint property_id,
1002                                                GValue * value,
1003                                                GParamSpec * pspec)
1004 {
1005 	GeeBenchmarkMountsInt32 * self;
1006 	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_BENCHMARK_TYPE_MOUNTS_INT32, GeeBenchmarkMountsInt32);
1007 	switch (property_id) {
1008 		case GEE_BENCHMARK_MOUNTS_INT32_NAME_PROPERTY:
1009 		g_value_set_string (value, gee_benchmark_generator_get_name ((GeeBenchmarkGenerator*) self));
1010 		break;
1011 		default:
1012 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
1013 		break;
1014 	}
1015 }
1016 
1017 static void
gee_benchmark_reverse_sorted_int32_real_generate_collection(GeeBenchmarkGenerator * base,gint size,GeeCollection * collection)1018 gee_benchmark_reverse_sorted_int32_real_generate_collection (GeeBenchmarkGenerator* base,
1019                                                              gint size,
1020                                                              GeeCollection* collection)
1021 {
1022 	GeeBenchmarkReverseSortedInt32 * self;
1023 	self = (GeeBenchmarkReverseSortedInt32*) base;
1024 	g_return_if_fail (collection != NULL);
1025 	{
1026 		gint i = 0;
1027 		i = 0;
1028 		{
1029 			gboolean _tmp0_ = FALSE;
1030 			_tmp0_ = TRUE;
1031 			while (TRUE) {
1032 				if (!_tmp0_) {
1033 					gint _tmp1_;
1034 					_tmp1_ = i;
1035 					i = _tmp1_ + 1;
1036 				}
1037 				_tmp0_ = FALSE;
1038 				if (!(i < size)) {
1039 					break;
1040 				}
1041 				gee_collection_add (collection, (gpointer) ((gintptr) ((gint32) ((size - i) - 1))));
1042 			}
1043 		}
1044 	}
1045 }
1046 
1047 GeeBenchmarkReverseSortedInt32*
gee_benchmark_reverse_sorted_int32_construct(GType object_type)1048 gee_benchmark_reverse_sorted_int32_construct (GType object_type)
1049 {
1050 	GeeBenchmarkReverseSortedInt32 * self = NULL;
1051 	self = (GeeBenchmarkReverseSortedInt32*) g_object_new (object_type, NULL);
1052 	return self;
1053 }
1054 
1055 GeeBenchmarkReverseSortedInt32*
gee_benchmark_reverse_sorted_int32_new(void)1056 gee_benchmark_reverse_sorted_int32_new (void)
1057 {
1058 	return gee_benchmark_reverse_sorted_int32_construct (GEE_BENCHMARK_TYPE_REVERSE_SORTED_INT32);
1059 }
1060 
1061 static const gchar*
gee_benchmark_reverse_sorted_int32_real_get_name(GeeBenchmarkGenerator * base)1062 gee_benchmark_reverse_sorted_int32_real_get_name (GeeBenchmarkGenerator* base)
1063 {
1064 	const gchar* result;
1065 	GeeBenchmarkReverseSortedInt32* self;
1066 	self = (GeeBenchmarkReverseSortedInt32*) base;
1067 	result = "ReverseSorted";
1068 	return result;
1069 }
1070 
1071 static void
gee_benchmark_reverse_sorted_int32_class_init(GeeBenchmarkReverseSortedInt32Class * klass,gpointer klass_data)1072 gee_benchmark_reverse_sorted_int32_class_init (GeeBenchmarkReverseSortedInt32Class * klass,
1073                                                gpointer klass_data)
1074 {
1075 	gee_benchmark_reverse_sorted_int32_parent_class = g_type_class_peek_parent (klass);
1076 	G_OBJECT_CLASS (klass)->get_property = _vala_gee_benchmark_reverse_sorted_int32_get_property;
1077 	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_BENCHMARK_REVERSE_SORTED_INT32_NAME_PROPERTY, gee_benchmark_reverse_sorted_int32_properties[GEE_BENCHMARK_REVERSE_SORTED_INT32_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
1078 }
1079 
1080 static void
gee_benchmark_reverse_sorted_int32_gee_benchmark_generator_interface_init(GeeBenchmarkGeneratorIface * iface,gpointer iface_data)1081 gee_benchmark_reverse_sorted_int32_gee_benchmark_generator_interface_init (GeeBenchmarkGeneratorIface * iface,
1082                                                                            gpointer iface_data)
1083 {
1084 	gee_benchmark_reverse_sorted_int32_gee_benchmark_generator_parent_iface = g_type_interface_peek_parent (iface);
1085 	iface->generate_collection = (void (*) (GeeBenchmarkGenerator*, gint, GeeCollection*)) gee_benchmark_reverse_sorted_int32_real_generate_collection;
1086 	iface->get_name = gee_benchmark_reverse_sorted_int32_real_get_name;
1087 }
1088 
1089 static void
gee_benchmark_reverse_sorted_int32_instance_init(GeeBenchmarkReverseSortedInt32 * self,gpointer klass)1090 gee_benchmark_reverse_sorted_int32_instance_init (GeeBenchmarkReverseSortedInt32 * self,
1091                                                   gpointer klass)
1092 {
1093 }
1094 
1095 GType
gee_benchmark_reverse_sorted_int32_get_type(void)1096 gee_benchmark_reverse_sorted_int32_get_type (void)
1097 {
1098 	static volatile gsize gee_benchmark_reverse_sorted_int32_type_id__volatile = 0;
1099 	if (g_once_init_enter (&gee_benchmark_reverse_sorted_int32_type_id__volatile)) {
1100 		static const GTypeInfo g_define_type_info = { sizeof (GeeBenchmarkReverseSortedInt32Class), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_benchmark_reverse_sorted_int32_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeBenchmarkReverseSortedInt32), 0, (GInstanceInitFunc) gee_benchmark_reverse_sorted_int32_instance_init, NULL };
1101 		static const GInterfaceInfo gee_benchmark_generator_info = { (GInterfaceInitFunc) gee_benchmark_reverse_sorted_int32_gee_benchmark_generator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
1102 		GType gee_benchmark_reverse_sorted_int32_type_id;
1103 		gee_benchmark_reverse_sorted_int32_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeBenchmarkReverseSortedInt32", &g_define_type_info, 0);
1104 		g_type_add_interface_static (gee_benchmark_reverse_sorted_int32_type_id, GEE_BENCHMARK_TYPE_GENERATOR, &gee_benchmark_generator_info);
1105 		g_once_init_leave (&gee_benchmark_reverse_sorted_int32_type_id__volatile, gee_benchmark_reverse_sorted_int32_type_id);
1106 	}
1107 	return gee_benchmark_reverse_sorted_int32_type_id__volatile;
1108 }
1109 
1110 static void
_vala_gee_benchmark_reverse_sorted_int32_get_property(GObject * object,guint property_id,GValue * value,GParamSpec * pspec)1111 _vala_gee_benchmark_reverse_sorted_int32_get_property (GObject * object,
1112                                                        guint property_id,
1113                                                        GValue * value,
1114                                                        GParamSpec * pspec)
1115 {
1116 	GeeBenchmarkReverseSortedInt32 * self;
1117 	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_BENCHMARK_TYPE_REVERSE_SORTED_INT32, GeeBenchmarkReverseSortedInt32);
1118 	switch (property_id) {
1119 		case GEE_BENCHMARK_REVERSE_SORTED_INT32_NAME_PROPERTY:
1120 		g_value_set_string (value, gee_benchmark_generator_get_name ((GeeBenchmarkGenerator*) self));
1121 		break;
1122 		default:
1123 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
1124 		break;
1125 	}
1126 }
1127 
1128 static void
gee_benchmark_sorted_int32_real_generate_collection(GeeBenchmarkGenerator * base,gint size,GeeCollection * collection)1129 gee_benchmark_sorted_int32_real_generate_collection (GeeBenchmarkGenerator* base,
1130                                                      gint size,
1131                                                      GeeCollection* collection)
1132 {
1133 	GeeBenchmarkSortedInt32 * self;
1134 	self = (GeeBenchmarkSortedInt32*) base;
1135 	g_return_if_fail (collection != NULL);
1136 	{
1137 		gint i = 0;
1138 		i = 0;
1139 		{
1140 			gboolean _tmp0_ = FALSE;
1141 			_tmp0_ = TRUE;
1142 			while (TRUE) {
1143 				if (!_tmp0_) {
1144 					gint _tmp1_;
1145 					_tmp1_ = i;
1146 					i = _tmp1_ + 1;
1147 				}
1148 				_tmp0_ = FALSE;
1149 				if (!(i < size)) {
1150 					break;
1151 				}
1152 				gee_collection_add (collection, (gpointer) ((gintptr) ((gint32) i)));
1153 			}
1154 		}
1155 	}
1156 }
1157 
1158 GeeBenchmarkSortedInt32*
gee_benchmark_sorted_int32_construct(GType object_type)1159 gee_benchmark_sorted_int32_construct (GType object_type)
1160 {
1161 	GeeBenchmarkSortedInt32 * self = NULL;
1162 	self = (GeeBenchmarkSortedInt32*) g_object_new (object_type, NULL);
1163 	return self;
1164 }
1165 
1166 GeeBenchmarkSortedInt32*
gee_benchmark_sorted_int32_new(void)1167 gee_benchmark_sorted_int32_new (void)
1168 {
1169 	return gee_benchmark_sorted_int32_construct (GEE_BENCHMARK_TYPE_SORTED_INT32);
1170 }
1171 
1172 static const gchar*
gee_benchmark_sorted_int32_real_get_name(GeeBenchmarkGenerator * base)1173 gee_benchmark_sorted_int32_real_get_name (GeeBenchmarkGenerator* base)
1174 {
1175 	const gchar* result;
1176 	GeeBenchmarkSortedInt32* self;
1177 	self = (GeeBenchmarkSortedInt32*) base;
1178 	result = "Sorted";
1179 	return result;
1180 }
1181 
1182 static void
gee_benchmark_sorted_int32_class_init(GeeBenchmarkSortedInt32Class * klass,gpointer klass_data)1183 gee_benchmark_sorted_int32_class_init (GeeBenchmarkSortedInt32Class * klass,
1184                                        gpointer klass_data)
1185 {
1186 	gee_benchmark_sorted_int32_parent_class = g_type_class_peek_parent (klass);
1187 	G_OBJECT_CLASS (klass)->get_property = _vala_gee_benchmark_sorted_int32_get_property;
1188 	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_BENCHMARK_SORTED_INT32_NAME_PROPERTY, gee_benchmark_sorted_int32_properties[GEE_BENCHMARK_SORTED_INT32_NAME_PROPERTY] = g_param_spec_string ("name", "name", "name", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
1189 }
1190 
1191 static void
gee_benchmark_sorted_int32_gee_benchmark_generator_interface_init(GeeBenchmarkGeneratorIface * iface,gpointer iface_data)1192 gee_benchmark_sorted_int32_gee_benchmark_generator_interface_init (GeeBenchmarkGeneratorIface * iface,
1193                                                                    gpointer iface_data)
1194 {
1195 	gee_benchmark_sorted_int32_gee_benchmark_generator_parent_iface = g_type_interface_peek_parent (iface);
1196 	iface->generate_collection = (void (*) (GeeBenchmarkGenerator*, gint, GeeCollection*)) gee_benchmark_sorted_int32_real_generate_collection;
1197 	iface->get_name = gee_benchmark_sorted_int32_real_get_name;
1198 }
1199 
1200 static void
gee_benchmark_sorted_int32_instance_init(GeeBenchmarkSortedInt32 * self,gpointer klass)1201 gee_benchmark_sorted_int32_instance_init (GeeBenchmarkSortedInt32 * self,
1202                                           gpointer klass)
1203 {
1204 }
1205 
1206 GType
gee_benchmark_sorted_int32_get_type(void)1207 gee_benchmark_sorted_int32_get_type (void)
1208 {
1209 	static volatile gsize gee_benchmark_sorted_int32_type_id__volatile = 0;
1210 	if (g_once_init_enter (&gee_benchmark_sorted_int32_type_id__volatile)) {
1211 		static const GTypeInfo g_define_type_info = { sizeof (GeeBenchmarkSortedInt32Class), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_benchmark_sorted_int32_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeBenchmarkSortedInt32), 0, (GInstanceInitFunc) gee_benchmark_sorted_int32_instance_init, NULL };
1212 		static const GInterfaceInfo gee_benchmark_generator_info = { (GInterfaceInitFunc) gee_benchmark_sorted_int32_gee_benchmark_generator_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
1213 		GType gee_benchmark_sorted_int32_type_id;
1214 		gee_benchmark_sorted_int32_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeBenchmarkSortedInt32", &g_define_type_info, 0);
1215 		g_type_add_interface_static (gee_benchmark_sorted_int32_type_id, GEE_BENCHMARK_TYPE_GENERATOR, &gee_benchmark_generator_info);
1216 		g_once_init_leave (&gee_benchmark_sorted_int32_type_id__volatile, gee_benchmark_sorted_int32_type_id);
1217 	}
1218 	return gee_benchmark_sorted_int32_type_id__volatile;
1219 }
1220 
1221 static void
_vala_gee_benchmark_sorted_int32_get_property(GObject * object,guint property_id,GValue * value,GParamSpec * pspec)1222 _vala_gee_benchmark_sorted_int32_get_property (GObject * object,
1223                                                guint property_id,
1224                                                GValue * value,
1225                                                GParamSpec * pspec)
1226 {
1227 	GeeBenchmarkSortedInt32 * self;
1228 	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_BENCHMARK_TYPE_SORTED_INT32, GeeBenchmarkSortedInt32);
1229 	switch (property_id) {
1230 		case GEE_BENCHMARK_SORTED_INT32_NAME_PROPERTY:
1231 		g_value_set_string (value, gee_benchmark_generator_get_name ((GeeBenchmarkGenerator*) self));
1232 		break;
1233 		default:
1234 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
1235 		break;
1236 	}
1237 }
1238 
1239 static inline gpointer
gee_benchmark_array_list_factory_get_instance_private(GeeBenchmarkArrayListFactory * self)1240 gee_benchmark_array_list_factory_get_instance_private (GeeBenchmarkArrayListFactory* self)
1241 {
1242 	return G_STRUCT_MEMBER_P (self, GeeBenchmarkArrayListFactory_private_offset);
1243 }
1244 
1245 static GeeCollection*
gee_benchmark_array_list_factory_real_create(GeeBenchmarkFactory * base)1246 gee_benchmark_array_list_factory_real_create (GeeBenchmarkFactory* base)
1247 {
1248 	GeeBenchmarkArrayListFactory * self;
1249 	GeeArrayList* _tmp0_;
1250 	GeeCollection* result = NULL;
1251 	self = (GeeBenchmarkArrayListFactory*) base;
1252 	_tmp0_ = gee_array_list_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, NULL, NULL, NULL);
1253 	result = (GeeCollection*) _tmp0_;
1254 	return result;
1255 }
1256 
1257 static GeeCollection*
gee_benchmark_array_list_factory_real_copy(GeeBenchmarkFactory * base,GeeCollection * collection)1258 gee_benchmark_array_list_factory_real_copy (GeeBenchmarkFactory* base,
1259                                             GeeCollection* collection)
1260 {
1261 	GeeBenchmarkArrayListFactory * self;
1262 	GeeArrayList* copy = NULL;
1263 	GeeArrayList* _tmp0_;
1264 	GeeCollection* result = NULL;
1265 	self = (GeeBenchmarkArrayListFactory*) base;
1266 	g_return_val_if_fail (collection != NULL, NULL);
1267 	_tmp0_ = gee_array_list_new (self->priv->g_type, (GBoxedCopyFunc) self->priv->g_dup_func, (GDestroyNotify) self->priv->g_destroy_func, NULL, NULL, NULL);
1268 	copy = _tmp0_;
1269 	{
1270 		GeeIterator* _item_it = NULL;
1271 		GeeIterator* _tmp1_;
1272 		_tmp1_ = gee_iterable_iterator ((GeeIterable*) collection);
1273 		_item_it = _tmp1_;
1274 		while (TRUE) {
1275 			GeeIterator* _tmp2_;
1276 			gpointer item = NULL;
1277 			GeeIterator* _tmp3_;
1278 			gpointer _tmp4_;
1279 			GeeArrayList* _tmp5_;
1280 			gconstpointer _tmp6_;
1281 			_tmp2_ = _item_it;
1282 			if (!gee_iterator_next (_tmp2_)) {
1283 				break;
1284 			}
1285 			_tmp3_ = _item_it;
1286 			_tmp4_ = gee_iterator_get (_tmp3_);
1287 			item = _tmp4_;
1288 			_tmp5_ = copy;
1289 			_tmp6_ = item;
1290 			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp5_, _tmp6_);
1291 			((item == NULL) || (self->priv->g_destroy_func == NULL)) ? NULL : (item = (self->priv->g_destroy_func (item), NULL));
1292 		}
1293 		_g_object_unref0 (_item_it);
1294 	}
1295 	result = (GeeCollection*) copy;
1296 	return result;
1297 }
1298 
1299 GeeBenchmarkArrayListFactory*
gee_benchmark_array_list_factory_construct(GType object_type,GType g_type,GBoxedCopyFunc g_dup_func,GDestroyNotify g_destroy_func)1300 gee_benchmark_array_list_factory_construct (GType object_type,
1301                                             GType g_type,
1302                                             GBoxedCopyFunc g_dup_func,
1303                                             GDestroyNotify g_destroy_func)
1304 {
1305 	GeeBenchmarkArrayListFactory * self = NULL;
1306 	self = (GeeBenchmarkArrayListFactory*) g_object_new (object_type, NULL);
1307 	self->priv->g_type = g_type;
1308 	self->priv->g_dup_func = g_dup_func;
1309 	self->priv->g_destroy_func = g_destroy_func;
1310 	return self;
1311 }
1312 
1313 GeeBenchmarkArrayListFactory*
gee_benchmark_array_list_factory_new(GType g_type,GBoxedCopyFunc g_dup_func,GDestroyNotify g_destroy_func)1314 gee_benchmark_array_list_factory_new (GType g_type,
1315                                       GBoxedCopyFunc g_dup_func,
1316                                       GDestroyNotify g_destroy_func)
1317 {
1318 	return gee_benchmark_array_list_factory_construct (GEE_BENCHMARK_TYPE_ARRAY_LIST_FACTORY, g_type, g_dup_func, g_destroy_func);
1319 }
1320 
1321 static void
gee_benchmark_array_list_factory_class_init(GeeBenchmarkArrayListFactoryClass * klass,gpointer klass_data)1322 gee_benchmark_array_list_factory_class_init (GeeBenchmarkArrayListFactoryClass * klass,
1323                                              gpointer klass_data)
1324 {
1325 	gee_benchmark_array_list_factory_parent_class = g_type_class_peek_parent (klass);
1326 	g_type_class_adjust_private_offset (klass, &GeeBenchmarkArrayListFactory_private_offset);
1327 	G_OBJECT_CLASS (klass)->get_property = _vala_gee_benchmark_array_list_factory_get_property;
1328 	G_OBJECT_CLASS (klass)->set_property = _vala_gee_benchmark_array_list_factory_set_property;
1329 	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_BENCHMARK_ARRAY_LIST_FACTORY_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
1330 	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_BENCHMARK_ARRAY_LIST_FACTORY_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
1331 	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_BENCHMARK_ARRAY_LIST_FACTORY_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
1332 }
1333 
1334 static void
gee_benchmark_array_list_factory_gee_benchmark_factory_interface_init(GeeBenchmarkFactoryIface * iface,gpointer iface_data)1335 gee_benchmark_array_list_factory_gee_benchmark_factory_interface_init (GeeBenchmarkFactoryIface * iface,
1336                                                                        gpointer iface_data)
1337 {
1338 	gee_benchmark_array_list_factory_gee_benchmark_factory_parent_iface = g_type_interface_peek_parent (iface);
1339 	iface->create = (GeeCollection* (*) (GeeBenchmarkFactory*)) gee_benchmark_array_list_factory_real_create;
1340 	iface->copy = (GeeCollection* (*) (GeeBenchmarkFactory*, GeeCollection*)) gee_benchmark_array_list_factory_real_copy;
1341 }
1342 
1343 static void
gee_benchmark_array_list_factory_instance_init(GeeBenchmarkArrayListFactory * self,gpointer klass)1344 gee_benchmark_array_list_factory_instance_init (GeeBenchmarkArrayListFactory * self,
1345                                                 gpointer klass)
1346 {
1347 	self->priv = gee_benchmark_array_list_factory_get_instance_private (self);
1348 }
1349 
1350 GType
gee_benchmark_array_list_factory_get_type(void)1351 gee_benchmark_array_list_factory_get_type (void)
1352 {
1353 	static volatile gsize gee_benchmark_array_list_factory_type_id__volatile = 0;
1354 	if (g_once_init_enter (&gee_benchmark_array_list_factory_type_id__volatile)) {
1355 		static const GTypeInfo g_define_type_info = { sizeof (GeeBenchmarkArrayListFactoryClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_benchmark_array_list_factory_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeBenchmarkArrayListFactory), 0, (GInstanceInitFunc) gee_benchmark_array_list_factory_instance_init, NULL };
1356 		static const GInterfaceInfo gee_benchmark_factory_info = { (GInterfaceInitFunc) gee_benchmark_array_list_factory_gee_benchmark_factory_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
1357 		GType gee_benchmark_array_list_factory_type_id;
1358 		gee_benchmark_array_list_factory_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeBenchmarkArrayListFactory", &g_define_type_info, 0);
1359 		g_type_add_interface_static (gee_benchmark_array_list_factory_type_id, GEE_BENCHMARK_TYPE_FACTORY, &gee_benchmark_factory_info);
1360 		GeeBenchmarkArrayListFactory_private_offset = g_type_add_instance_private (gee_benchmark_array_list_factory_type_id, sizeof (GeeBenchmarkArrayListFactoryPrivate));
1361 		g_once_init_leave (&gee_benchmark_array_list_factory_type_id__volatile, gee_benchmark_array_list_factory_type_id);
1362 	}
1363 	return gee_benchmark_array_list_factory_type_id__volatile;
1364 }
1365 
1366 static void
_vala_gee_benchmark_array_list_factory_get_property(GObject * object,guint property_id,GValue * value,GParamSpec * pspec)1367 _vala_gee_benchmark_array_list_factory_get_property (GObject * object,
1368                                                      guint property_id,
1369                                                      GValue * value,
1370                                                      GParamSpec * pspec)
1371 {
1372 	GeeBenchmarkArrayListFactory * self;
1373 	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_BENCHMARK_TYPE_ARRAY_LIST_FACTORY, GeeBenchmarkArrayListFactory);
1374 	switch (property_id) {
1375 		case GEE_BENCHMARK_ARRAY_LIST_FACTORY_G_TYPE:
1376 		g_value_set_gtype (value, self->priv->g_type);
1377 		break;
1378 		case GEE_BENCHMARK_ARRAY_LIST_FACTORY_G_DUP_FUNC:
1379 		g_value_set_pointer (value, self->priv->g_dup_func);
1380 		break;
1381 		case GEE_BENCHMARK_ARRAY_LIST_FACTORY_G_DESTROY_FUNC:
1382 		g_value_set_pointer (value, self->priv->g_destroy_func);
1383 		break;
1384 		default:
1385 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
1386 		break;
1387 	}
1388 }
1389 
1390 static void
_vala_gee_benchmark_array_list_factory_set_property(GObject * object,guint property_id,const GValue * value,GParamSpec * pspec)1391 _vala_gee_benchmark_array_list_factory_set_property (GObject * object,
1392                                                      guint property_id,
1393                                                      const GValue * value,
1394                                                      GParamSpec * pspec)
1395 {
1396 	GeeBenchmarkArrayListFactory * self;
1397 	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_BENCHMARK_TYPE_ARRAY_LIST_FACTORY, GeeBenchmarkArrayListFactory);
1398 	switch (property_id) {
1399 		case GEE_BENCHMARK_ARRAY_LIST_FACTORY_G_TYPE:
1400 		self->priv->g_type = g_value_get_gtype (value);
1401 		break;
1402 		case GEE_BENCHMARK_ARRAY_LIST_FACTORY_G_DUP_FUNC:
1403 		self->priv->g_dup_func = g_value_get_pointer (value);
1404 		break;
1405 		case GEE_BENCHMARK_ARRAY_LIST_FACTORY_G_DESTROY_FUNC:
1406 		self->priv->g_destroy_func = g_value_get_pointer (value);
1407 		break;
1408 		default:
1409 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
1410 		break;
1411 	}
1412 }
1413 
1414 static inline gpointer
gee_benchmark_benchmark_get_instance_private(GeeBenchmarkBenchmark * self)1415 gee_benchmark_benchmark_get_instance_private (GeeBenchmarkBenchmark* self)
1416 {
1417 	return G_STRUCT_MEMBER_P (self, GeeBenchmarkBenchmark_private_offset);
1418 }
1419 
1420 static gpointer
_g_object_ref0(gpointer self)1421 _g_object_ref0 (gpointer self)
1422 {
1423 	return self ? g_object_ref (self) : NULL;
1424 }
1425 
1426 static gint*
_vala_array_dup1(gint * self,int length)1427 _vala_array_dup1 (gint* self,
1428                   int length)
1429 {
1430 	return g_memdup (self, length * sizeof (gint));
1431 }
1432 
1433 GeeBenchmarkBenchmark*
gee_benchmark_benchmark_construct(GType object_type,GType g_type,GBoxedCopyFunc g_dup_func,GDestroyNotify g_destroy_func,GeeBenchmarkFactory * factory,GeeList * algorithms,GeeList * generators,gint * sizes,gint sizes_length1,gint iteration_count)1434 gee_benchmark_benchmark_construct (GType object_type,
1435                                    GType g_type,
1436                                    GBoxedCopyFunc g_dup_func,
1437                                    GDestroyNotify g_destroy_func,
1438                                    GeeBenchmarkFactory* factory,
1439                                    GeeList* algorithms,
1440                                    GeeList* generators,
1441                                    gint* sizes,
1442                                    gint sizes_length1,
1443                                    gint iteration_count)
1444 {
1445 	GeeBenchmarkBenchmark * self = NULL;
1446 	GeeBenchmarkFactory* _tmp0_;
1447 	GeeList* _tmp1_;
1448 	gint* _tmp2_;
1449 	gint _tmp2__length1;
1450 	GeeList* _tmp3_;
1451 	g_return_val_if_fail (factory != NULL, NULL);
1452 	g_return_val_if_fail (algorithms != NULL, NULL);
1453 	g_return_val_if_fail (generators != NULL, NULL);
1454 	self = (GeeBenchmarkBenchmark*) g_object_new (object_type, NULL);
1455 	self->priv->g_type = g_type;
1456 	self->priv->g_dup_func = g_dup_func;
1457 	self->priv->g_destroy_func = g_destroy_func;
1458 	_tmp0_ = _g_object_ref0 (factory);
1459 	_g_object_unref0 (self->priv->factory);
1460 	self->priv->factory = _tmp0_;
1461 	_tmp1_ = _g_object_ref0 (algorithms);
1462 	_g_object_unref0 (self->priv->algorithms);
1463 	self->priv->algorithms = _tmp1_;
1464 	_tmp2_ = (sizes != NULL) ? _vala_array_dup1 (sizes, sizes_length1) : ((gpointer) sizes);
1465 	_tmp2__length1 = sizes_length1;
1466 	self->priv->sizes = (g_free (self->priv->sizes), NULL);
1467 	self->priv->sizes = _tmp2_;
1468 	self->priv->sizes_length1 = _tmp2__length1;
1469 	self->priv->_sizes_size_ = self->priv->sizes_length1;
1470 	_tmp3_ = _g_object_ref0 (generators);
1471 	_g_object_unref0 (self->priv->generators);
1472 	self->priv->generators = _tmp3_;
1473 	self->priv->iteration_count = iteration_count;
1474 	return self;
1475 }
1476 
1477 GeeBenchmarkBenchmark*
gee_benchmark_benchmark_new(GType g_type,GBoxedCopyFunc g_dup_func,GDestroyNotify g_destroy_func,GeeBenchmarkFactory * factory,GeeList * algorithms,GeeList * generators,gint * sizes,gint sizes_length1,gint iteration_count)1478 gee_benchmark_benchmark_new (GType g_type,
1479                              GBoxedCopyFunc g_dup_func,
1480                              GDestroyNotify g_destroy_func,
1481                              GeeBenchmarkFactory* factory,
1482                              GeeList* algorithms,
1483                              GeeList* generators,
1484                              gint* sizes,
1485                              gint sizes_length1,
1486                              gint iteration_count)
1487 {
1488 	return gee_benchmark_benchmark_construct (GEE_BENCHMARK_TYPE_BENCHMARK, g_type, g_dup_func, g_destroy_func, factory, algorithms, generators, sizes, sizes_length1, iteration_count);
1489 }
1490 
1491 void
gee_benchmark_benchmark_run(GeeBenchmarkBenchmark * self)1492 gee_benchmark_benchmark_run (GeeBenchmarkBenchmark* self)
1493 {
1494 	gint* _tmp0_;
1495 	gint _tmp0__length1;
1496 	GeeList* _tmp1_;
1497 	gint _tmp2_;
1498 	gint _tmp3_;
1499 	GeeList* _tmp4_;
1500 	gint _tmp5_;
1501 	gint _tmp6_;
1502 	gdouble* _tmp7_;
1503 	gint* _tmp8_;
1504 	gint _tmp8__length1;
1505 	GeeList* _tmp9_;
1506 	gint _tmp10_;
1507 	gint _tmp11_;
1508 	GeeList* _tmp12_;
1509 	gint _tmp13_;
1510 	gint _tmp14_;
1511 	gdouble* _tmp15_;
1512 	GTimer* timer = NULL;
1513 	GTimer* _tmp31_;
1514 	g_return_if_fail (self != NULL);
1515 	_tmp0_ = self->priv->sizes;
1516 	_tmp0__length1 = self->priv->sizes_length1;
1517 	_tmp1_ = self->priv->generators;
1518 	_tmp2_ = gee_collection_get_size ((GeeCollection*) _tmp1_);
1519 	_tmp3_ = _tmp2_;
1520 	_tmp4_ = self->priv->algorithms;
1521 	_tmp5_ = gee_collection_get_size ((GeeCollection*) _tmp4_);
1522 	_tmp6_ = _tmp5_;
1523 	_tmp7_ = g_new0 (gdouble, (_tmp0__length1 * _tmp3_) * _tmp6_);
1524 	self->priv->results_sum = (g_free (self->priv->results_sum), NULL);
1525 	self->priv->results_sum = _tmp7_;
1526 	self->priv->results_sum_length1 = _tmp0__length1;
1527 	self->priv->results_sum_length2 = _tmp3_;
1528 	self->priv->results_sum_length3 = _tmp6_;
1529 	_tmp8_ = self->priv->sizes;
1530 	_tmp8__length1 = self->priv->sizes_length1;
1531 	_tmp9_ = self->priv->generators;
1532 	_tmp10_ = gee_collection_get_size ((GeeCollection*) _tmp9_);
1533 	_tmp11_ = _tmp10_;
1534 	_tmp12_ = self->priv->algorithms;
1535 	_tmp13_ = gee_collection_get_size ((GeeCollection*) _tmp12_);
1536 	_tmp14_ = _tmp13_;
1537 	_tmp15_ = g_new0 (gdouble, (_tmp8__length1 * _tmp11_) * _tmp14_);
1538 	self->priv->results_squared_sum = (g_free (self->priv->results_squared_sum), NULL);
1539 	self->priv->results_squared_sum = _tmp15_;
1540 	self->priv->results_squared_sum_length1 = _tmp8__length1;
1541 	self->priv->results_squared_sum_length2 = _tmp11_;
1542 	self->priv->results_squared_sum_length3 = _tmp14_;
1543 	{
1544 		gint i = 0;
1545 		i = 0;
1546 		{
1547 			gboolean _tmp16_ = FALSE;
1548 			_tmp16_ = TRUE;
1549 			while (TRUE) {
1550 				gint* _tmp18_;
1551 				gint _tmp18__length1;
1552 				if (!_tmp16_) {
1553 					gint _tmp17_;
1554 					_tmp17_ = i;
1555 					i = _tmp17_ + 1;
1556 				}
1557 				_tmp16_ = FALSE;
1558 				_tmp18_ = self->priv->sizes;
1559 				_tmp18__length1 = self->priv->sizes_length1;
1560 				if (!(i < _tmp18__length1)) {
1561 					break;
1562 				}
1563 				{
1564 					gint j = 0;
1565 					j = 0;
1566 					{
1567 						gboolean _tmp19_ = FALSE;
1568 						_tmp19_ = TRUE;
1569 						while (TRUE) {
1570 							GeeList* _tmp21_;
1571 							gint _tmp22_;
1572 							gint _tmp23_;
1573 							if (!_tmp19_) {
1574 								gint _tmp20_;
1575 								_tmp20_ = j;
1576 								j = _tmp20_ + 1;
1577 							}
1578 							_tmp19_ = FALSE;
1579 							_tmp21_ = self->priv->generators;
1580 							_tmp22_ = gee_collection_get_size ((GeeCollection*) _tmp21_);
1581 							_tmp23_ = _tmp22_;
1582 							if (!(j < _tmp23_)) {
1583 								break;
1584 							}
1585 							{
1586 								gint k = 0;
1587 								k = 0;
1588 								{
1589 									gboolean _tmp24_ = FALSE;
1590 									_tmp24_ = TRUE;
1591 									while (TRUE) {
1592 										GeeList* _tmp26_;
1593 										gint _tmp27_;
1594 										gint _tmp28_;
1595 										gdouble* _tmp29_;
1596 										gint _tmp29__length1;
1597 										gint _tmp29__length2;
1598 										gint _tmp29__length3;
1599 										gdouble* _tmp30_;
1600 										gint _tmp30__length1;
1601 										gint _tmp30__length2;
1602 										gint _tmp30__length3;
1603 										if (!_tmp24_) {
1604 											gint _tmp25_;
1605 											_tmp25_ = k;
1606 											k = _tmp25_ + 1;
1607 										}
1608 										_tmp24_ = FALSE;
1609 										_tmp26_ = self->priv->algorithms;
1610 										_tmp27_ = gee_collection_get_size ((GeeCollection*) _tmp26_);
1611 										_tmp28_ = _tmp27_;
1612 										if (!(k < _tmp28_)) {
1613 											break;
1614 										}
1615 										_tmp29_ = self->priv->results_sum;
1616 										_tmp29__length1 = self->priv->results_sum_length1;
1617 										_tmp29__length2 = self->priv->results_sum_length2;
1618 										_tmp29__length3 = self->priv->results_sum_length3;
1619 										_tmp29_[(((i * _tmp29__length2) + j) * _tmp29__length3) + k] = (gdouble) 0;
1620 										_tmp30_ = self->priv->results_squared_sum;
1621 										_tmp30__length1 = self->priv->results_squared_sum_length1;
1622 										_tmp30__length2 = self->priv->results_squared_sum_length2;
1623 										_tmp30__length3 = self->priv->results_squared_sum_length3;
1624 										_tmp30_[(((i * _tmp30__length2) + j) * _tmp30__length3) + k] = (gdouble) 0;
1625 									}
1626 								}
1627 							}
1628 						}
1629 					}
1630 				}
1631 			}
1632 		}
1633 	}
1634 	_tmp31_ = g_timer_new ();
1635 	timer = _tmp31_;
1636 	{
1637 		gint iteration = 0;
1638 		iteration = 1;
1639 		{
1640 			gboolean _tmp32_ = FALSE;
1641 			_tmp32_ = TRUE;
1642 			while (TRUE) {
1643 				FILE* _tmp70_;
1644 				if (!_tmp32_) {
1645 					gint _tmp33_;
1646 					_tmp33_ = iteration;
1647 					iteration = _tmp33_ + 1;
1648 				}
1649 				_tmp32_ = FALSE;
1650 				if (!(iteration <= self->priv->iteration_count)) {
1651 					break;
1652 				}
1653 				{
1654 					gint i = 0;
1655 					i = 0;
1656 					{
1657 						gboolean _tmp34_ = FALSE;
1658 						_tmp34_ = TRUE;
1659 						while (TRUE) {
1660 							gint* _tmp36_;
1661 							gint _tmp36__length1;
1662 							gint size = 0;
1663 							gint* _tmp37_;
1664 							gint _tmp37__length1;
1665 							gint _tmp38_;
1666 							if (!_tmp34_) {
1667 								gint _tmp35_;
1668 								_tmp35_ = i;
1669 								i = _tmp35_ + 1;
1670 							}
1671 							_tmp34_ = FALSE;
1672 							_tmp36_ = self->priv->sizes;
1673 							_tmp36__length1 = self->priv->sizes_length1;
1674 							if (!(i < _tmp36__length1)) {
1675 								break;
1676 							}
1677 							_tmp37_ = self->priv->sizes;
1678 							_tmp37__length1 = self->priv->sizes_length1;
1679 							_tmp38_ = _tmp37_[i];
1680 							size = _tmp38_;
1681 							{
1682 								gint j = 0;
1683 								j = 0;
1684 								{
1685 									gboolean _tmp39_ = FALSE;
1686 									_tmp39_ = TRUE;
1687 									while (TRUE) {
1688 										GeeList* _tmp41_;
1689 										gint _tmp42_;
1690 										gint _tmp43_;
1691 										GeeCollection* collection = NULL;
1692 										GeeBenchmarkFactory* _tmp44_;
1693 										GeeCollection* _tmp45_;
1694 										GeeList* _tmp46_;
1695 										gpointer _tmp47_;
1696 										GeeBenchmarkGenerator* _tmp48_;
1697 										GeeCollection* _tmp49_;
1698 										if (!_tmp39_) {
1699 											gint _tmp40_;
1700 											_tmp40_ = j;
1701 											j = _tmp40_ + 1;
1702 										}
1703 										_tmp39_ = FALSE;
1704 										_tmp41_ = self->priv->generators;
1705 										_tmp42_ = gee_collection_get_size ((GeeCollection*) _tmp41_);
1706 										_tmp43_ = _tmp42_;
1707 										if (!(j < _tmp43_)) {
1708 											break;
1709 										}
1710 										_tmp44_ = self->priv->factory;
1711 										_tmp45_ = gee_benchmark_factory_create (_tmp44_);
1712 										collection = _tmp45_;
1713 										_tmp46_ = self->priv->generators;
1714 										_tmp47_ = gee_list_get (_tmp46_, j);
1715 										_tmp48_ = (GeeBenchmarkGenerator*) _tmp47_;
1716 										_tmp49_ = collection;
1717 										gee_benchmark_generator_generate_collection (_tmp48_, size, _tmp49_);
1718 										_g_object_unref0 (_tmp48_);
1719 										{
1720 											gint k = 0;
1721 											k = 0;
1722 											{
1723 												gboolean _tmp50_ = FALSE;
1724 												_tmp50_ = TRUE;
1725 												while (TRUE) {
1726 													GeeList* _tmp52_;
1727 													gint _tmp53_;
1728 													gint _tmp54_;
1729 													GeeCollection* copy = NULL;
1730 													GeeBenchmarkFactory* _tmp55_;
1731 													GeeCollection* _tmp56_;
1732 													GeeCollection* _tmp57_;
1733 													GTimer* _tmp58_;
1734 													GTimer* _tmp59_;
1735 													GeeList* _tmp60_;
1736 													gpointer _tmp61_;
1737 													GeeBenchmarkAlgorithm* _tmp62_;
1738 													GeeCollection* _tmp63_;
1739 													GTimer* _tmp64_;
1740 													gdouble elapsed = 0.0;
1741 													GTimer* _tmp65_;
1742 													gdouble* _tmp66_;
1743 													gint _tmp66__length1;
1744 													gint _tmp66__length2;
1745 													gint _tmp66__length3;
1746 													gdouble* _tmp67_;
1747 													gint _tmp67__length1;
1748 													gint _tmp67__length2;
1749 													gint _tmp67__length3;
1750 													if (!_tmp50_) {
1751 														gint _tmp51_;
1752 														_tmp51_ = k;
1753 														k = _tmp51_ + 1;
1754 													}
1755 													_tmp50_ = FALSE;
1756 													_tmp52_ = self->priv->algorithms;
1757 													_tmp53_ = gee_collection_get_size ((GeeCollection*) _tmp52_);
1758 													_tmp54_ = _tmp53_;
1759 													if (!(k < _tmp54_)) {
1760 														break;
1761 													}
1762 													_tmp55_ = self->priv->factory;
1763 													_tmp56_ = collection;
1764 													_tmp57_ = gee_benchmark_factory_copy (_tmp55_, _tmp56_);
1765 													copy = _tmp57_;
1766 													_tmp58_ = timer;
1767 													g_timer_reset (_tmp58_);
1768 													_tmp59_ = timer;
1769 													g_timer_start (_tmp59_);
1770 													_tmp60_ = self->priv->algorithms;
1771 													_tmp61_ = gee_list_get (_tmp60_, k);
1772 													_tmp62_ = (GeeBenchmarkAlgorithm*) _tmp61_;
1773 													_tmp63_ = copy;
1774 													gee_benchmark_algorithm_process_collection (_tmp62_, _tmp63_);
1775 													_g_object_unref0 (_tmp62_);
1776 													_tmp64_ = timer;
1777 													g_timer_stop (_tmp64_);
1778 													_tmp65_ = timer;
1779 													elapsed = g_timer_elapsed (_tmp65_, NULL);
1780 													_tmp66_ = self->priv->results_sum;
1781 													_tmp66__length1 = self->priv->results_sum_length1;
1782 													_tmp66__length2 = self->priv->results_sum_length2;
1783 													_tmp66__length3 = self->priv->results_sum_length3;
1784 													_tmp66_[(((i * _tmp66__length2) + j) * _tmp66__length3) + k] += elapsed;
1785 													_tmp67_ = self->priv->results_squared_sum;
1786 													_tmp67__length1 = self->priv->results_squared_sum_length1;
1787 													_tmp67__length2 = self->priv->results_squared_sum_length2;
1788 													_tmp67__length3 = self->priv->results_squared_sum_length3;
1789 													_tmp67_[(((i * _tmp67__length2) + j) * _tmp67__length3) + k] += pow (elapsed, (gdouble) 2);
1790 													_g_object_unref0 (copy);
1791 												}
1792 											}
1793 										}
1794 										_g_object_unref0 (collection);
1795 									}
1796 								}
1797 							}
1798 						}
1799 					}
1800 				}
1801 				if ((iteration % 10) == 0) {
1802 					FILE* _tmp68_;
1803 					_tmp68_ = stdout;
1804 					fprintf (_tmp68_, "|");
1805 				} else {
1806 					FILE* _tmp69_;
1807 					_tmp69_ = stdout;
1808 					fprintf (_tmp69_, "*");
1809 				}
1810 				_tmp70_ = stdout;
1811 				fflush (_tmp70_);
1812 				if ((iteration % 100) == 0) {
1813 					FILE* _tmp71_;
1814 					_tmp71_ = stdout;
1815 					fprintf (_tmp71_, "\n\n");
1816 					gee_benchmark_benchmark_display_results (self, iteration);
1817 				}
1818 			}
1819 		}
1820 	}
1821 	_g_timer_destroy0 (timer);
1822 }
1823 
1824 void
gee_benchmark_benchmark_display_results(GeeBenchmarkBenchmark * self,gint iteration)1825 gee_benchmark_benchmark_display_results (GeeBenchmarkBenchmark* self,
1826                                          gint iteration)
1827 {
1828 	FILE* _tmp0_;
1829 	FILE* _tmp43_;
1830 	g_return_if_fail (self != NULL);
1831 	_tmp0_ = stdout;
1832 	fprintf (_tmp0_, "After %d iterations: (average [sample standard deviation] in seconds)\n" \
1833 "\n", iteration);
1834 	{
1835 		gint i = 0;
1836 		i = 0;
1837 		{
1838 			gboolean _tmp1_ = FALSE;
1839 			_tmp1_ = TRUE;
1840 			while (TRUE) {
1841 				gint* _tmp3_;
1842 				gint _tmp3__length1;
1843 				FILE* _tmp4_;
1844 				gint* _tmp5_;
1845 				gint _tmp5__length1;
1846 				gint _tmp6_;
1847 				FILE* _tmp7_;
1848 				FILE* _tmp19_;
1849 				FILE* _tmp42_;
1850 				if (!_tmp1_) {
1851 					gint _tmp2_;
1852 					_tmp2_ = i;
1853 					i = _tmp2_ + 1;
1854 				}
1855 				_tmp1_ = FALSE;
1856 				_tmp3_ = self->priv->sizes;
1857 				_tmp3__length1 = self->priv->sizes_length1;
1858 				if (!(i < _tmp3__length1)) {
1859 					break;
1860 				}
1861 				_tmp4_ = stdout;
1862 				_tmp5_ = self->priv->sizes;
1863 				_tmp5__length1 = self->priv->sizes_length1;
1864 				_tmp6_ = _tmp5_[i];
1865 				fprintf (_tmp4_, "%d elements:\n", _tmp6_);
1866 				_tmp7_ = stdout;
1867 				fprintf (_tmp7_, "%20s\t", "");
1868 				{
1869 					gint k = 0;
1870 					k = 0;
1871 					{
1872 						gboolean _tmp8_ = FALSE;
1873 						_tmp8_ = TRUE;
1874 						while (TRUE) {
1875 							GeeList* _tmp10_;
1876 							gint _tmp11_;
1877 							gint _tmp12_;
1878 							FILE* _tmp13_;
1879 							GeeList* _tmp14_;
1880 							gpointer _tmp15_;
1881 							GeeBenchmarkAlgorithm* _tmp16_;
1882 							const gchar* _tmp17_;
1883 							const gchar* _tmp18_;
1884 							if (!_tmp8_) {
1885 								gint _tmp9_;
1886 								_tmp9_ = k;
1887 								k = _tmp9_ + 1;
1888 							}
1889 							_tmp8_ = FALSE;
1890 							_tmp10_ = self->priv->algorithms;
1891 							_tmp11_ = gee_collection_get_size ((GeeCollection*) _tmp10_);
1892 							_tmp12_ = _tmp11_;
1893 							if (!(k < _tmp12_)) {
1894 								break;
1895 							}
1896 							_tmp13_ = stdout;
1897 							_tmp14_ = self->priv->algorithms;
1898 							_tmp15_ = gee_list_get (_tmp14_, k);
1899 							_tmp16_ = (GeeBenchmarkAlgorithm*) _tmp15_;
1900 							_tmp17_ = gee_benchmark_algorithm_get_name (_tmp16_);
1901 							_tmp18_ = _tmp17_;
1902 							fprintf (_tmp13_, "%-20s\t", _tmp18_);
1903 							_g_object_unref0 (_tmp16_);
1904 						}
1905 					}
1906 				}
1907 				_tmp19_ = stdout;
1908 				fprintf (_tmp19_, "\n");
1909 				{
1910 					gint j = 0;
1911 					j = 0;
1912 					{
1913 						gboolean _tmp20_ = FALSE;
1914 						_tmp20_ = TRUE;
1915 						while (TRUE) {
1916 							GeeList* _tmp22_;
1917 							gint _tmp23_;
1918 							gint _tmp24_;
1919 							FILE* _tmp25_;
1920 							GeeList* _tmp26_;
1921 							gpointer _tmp27_;
1922 							GeeBenchmarkGenerator* _tmp28_;
1923 							const gchar* _tmp29_;
1924 							const gchar* _tmp30_;
1925 							FILE* _tmp41_;
1926 							if (!_tmp20_) {
1927 								gint _tmp21_;
1928 								_tmp21_ = j;
1929 								j = _tmp21_ + 1;
1930 							}
1931 							_tmp20_ = FALSE;
1932 							_tmp22_ = self->priv->generators;
1933 							_tmp23_ = gee_collection_get_size ((GeeCollection*) _tmp22_);
1934 							_tmp24_ = _tmp23_;
1935 							if (!(j < _tmp24_)) {
1936 								break;
1937 							}
1938 							_tmp25_ = stdout;
1939 							_tmp26_ = self->priv->generators;
1940 							_tmp27_ = gee_list_get (_tmp26_, j);
1941 							_tmp28_ = (GeeBenchmarkGenerator*) _tmp27_;
1942 							_tmp29_ = gee_benchmark_generator_get_name (_tmp28_);
1943 							_tmp30_ = _tmp29_;
1944 							fprintf (_tmp25_, "%20s\t", _tmp30_);
1945 							_g_object_unref0 (_tmp28_);
1946 							{
1947 								gint k = 0;
1948 								k = 0;
1949 								{
1950 									gboolean _tmp31_ = FALSE;
1951 									_tmp31_ = TRUE;
1952 									while (TRUE) {
1953 										GeeList* _tmp33_;
1954 										gint _tmp34_;
1955 										gint _tmp35_;
1956 										gdouble average = 0.0;
1957 										gdouble* _tmp36_;
1958 										gint _tmp36__length1;
1959 										gint _tmp36__length2;
1960 										gint _tmp36__length3;
1961 										gdouble _tmp37_;
1962 										gdouble squared_deviation = 0.0;
1963 										gdouble* _tmp38_;
1964 										gint _tmp38__length1;
1965 										gint _tmp38__length2;
1966 										gint _tmp38__length3;
1967 										gdouble _tmp39_;
1968 										gdouble deviation = 0.0;
1969 										FILE* _tmp40_;
1970 										if (!_tmp31_) {
1971 											gint _tmp32_;
1972 											_tmp32_ = k;
1973 											k = _tmp32_ + 1;
1974 										}
1975 										_tmp31_ = FALSE;
1976 										_tmp33_ = self->priv->algorithms;
1977 										_tmp34_ = gee_collection_get_size ((GeeCollection*) _tmp33_);
1978 										_tmp35_ = _tmp34_;
1979 										if (!(k < _tmp35_)) {
1980 											break;
1981 										}
1982 										_tmp36_ = self->priv->results_sum;
1983 										_tmp36__length1 = self->priv->results_sum_length1;
1984 										_tmp36__length2 = self->priv->results_sum_length2;
1985 										_tmp36__length3 = self->priv->results_sum_length3;
1986 										_tmp37_ = _tmp36_[(((i * _tmp36__length2) + j) * _tmp36__length3) + k];
1987 										average = _tmp37_ / iteration;
1988 										_tmp38_ = self->priv->results_squared_sum;
1989 										_tmp38__length1 = self->priv->results_squared_sum_length1;
1990 										_tmp38__length2 = self->priv->results_squared_sum_length2;
1991 										_tmp38__length3 = self->priv->results_squared_sum_length3;
1992 										_tmp39_ = _tmp38_[(((i * _tmp38__length2) + j) * _tmp38__length3) + k];
1993 										squared_deviation = (_tmp39_ - (((gdouble) iteration) * pow (average, (gdouble) 2))) / (iteration - 1);
1994 										deviation = sqrt (squared_deviation);
1995 										_tmp40_ = stdout;
1996 										fprintf (_tmp40_, "%8f [%8f] \t", average, deviation);
1997 									}
1998 								}
1999 							}
2000 							_tmp41_ = stdout;
2001 							fprintf (_tmp41_, "\n");
2002 						}
2003 					}
2004 				}
2005 				_tmp42_ = stdout;
2006 				fprintf (_tmp42_, "\n");
2007 			}
2008 		}
2009 	}
2010 	_tmp43_ = stdout;
2011 	fprintf (_tmp43_, "\n\n");
2012 }
2013 
2014 static void
gee_benchmark_benchmark_class_init(GeeBenchmarkBenchmarkClass * klass,gpointer klass_data)2015 gee_benchmark_benchmark_class_init (GeeBenchmarkBenchmarkClass * klass,
2016                                     gpointer klass_data)
2017 {
2018 	gee_benchmark_benchmark_parent_class = g_type_class_peek_parent (klass);
2019 	g_type_class_adjust_private_offset (klass, &GeeBenchmarkBenchmark_private_offset);
2020 	G_OBJECT_CLASS (klass)->get_property = _vala_gee_benchmark_benchmark_get_property;
2021 	G_OBJECT_CLASS (klass)->set_property = _vala_gee_benchmark_benchmark_set_property;
2022 	G_OBJECT_CLASS (klass)->finalize = gee_benchmark_benchmark_finalize;
2023 	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_BENCHMARK_BENCHMARK_G_TYPE, g_param_spec_gtype ("g-type", "type", "type", G_TYPE_NONE, G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
2024 	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_BENCHMARK_BENCHMARK_G_DUP_FUNC, g_param_spec_pointer ("g-dup-func", "dup func", "dup func", G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
2025 	g_object_class_install_property (G_OBJECT_CLASS (klass), GEE_BENCHMARK_BENCHMARK_G_DESTROY_FUNC, g_param_spec_pointer ("g-destroy-func", "destroy func", "destroy func", G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
2026 }
2027 
2028 static void
gee_benchmark_benchmark_instance_init(GeeBenchmarkBenchmark * self,gpointer klass)2029 gee_benchmark_benchmark_instance_init (GeeBenchmarkBenchmark * self,
2030                                        gpointer klass)
2031 {
2032 	self->priv = gee_benchmark_benchmark_get_instance_private (self);
2033 }
2034 
2035 static void
gee_benchmark_benchmark_finalize(GObject * obj)2036 gee_benchmark_benchmark_finalize (GObject * obj)
2037 {
2038 	GeeBenchmarkBenchmark * self;
2039 	self = G_TYPE_CHECK_INSTANCE_CAST (obj, GEE_BENCHMARK_TYPE_BENCHMARK, GeeBenchmarkBenchmark);
2040 	_g_object_unref0 (self->priv->factory);
2041 	self->priv->sizes = (g_free (self->priv->sizes), NULL);
2042 	_g_object_unref0 (self->priv->generators);
2043 	_g_object_unref0 (self->priv->algorithms);
2044 	self->priv->results_sum = (g_free (self->priv->results_sum), NULL);
2045 	self->priv->results_squared_sum = (g_free (self->priv->results_squared_sum), NULL);
2046 	G_OBJECT_CLASS (gee_benchmark_benchmark_parent_class)->finalize (obj);
2047 }
2048 
2049 GType
gee_benchmark_benchmark_get_type(void)2050 gee_benchmark_benchmark_get_type (void)
2051 {
2052 	static volatile gsize gee_benchmark_benchmark_type_id__volatile = 0;
2053 	if (g_once_init_enter (&gee_benchmark_benchmark_type_id__volatile)) {
2054 		static const GTypeInfo g_define_type_info = { sizeof (GeeBenchmarkBenchmarkClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) gee_benchmark_benchmark_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (GeeBenchmarkBenchmark), 0, (GInstanceInitFunc) gee_benchmark_benchmark_instance_init, NULL };
2055 		GType gee_benchmark_benchmark_type_id;
2056 		gee_benchmark_benchmark_type_id = g_type_register_static (G_TYPE_OBJECT, "GeeBenchmarkBenchmark", &g_define_type_info, 0);
2057 		GeeBenchmarkBenchmark_private_offset = g_type_add_instance_private (gee_benchmark_benchmark_type_id, sizeof (GeeBenchmarkBenchmarkPrivate));
2058 		g_once_init_leave (&gee_benchmark_benchmark_type_id__volatile, gee_benchmark_benchmark_type_id);
2059 	}
2060 	return gee_benchmark_benchmark_type_id__volatile;
2061 }
2062 
2063 static void
_vala_gee_benchmark_benchmark_get_property(GObject * object,guint property_id,GValue * value,GParamSpec * pspec)2064 _vala_gee_benchmark_benchmark_get_property (GObject * object,
2065                                             guint property_id,
2066                                             GValue * value,
2067                                             GParamSpec * pspec)
2068 {
2069 	GeeBenchmarkBenchmark * self;
2070 	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_BENCHMARK_TYPE_BENCHMARK, GeeBenchmarkBenchmark);
2071 	switch (property_id) {
2072 		case GEE_BENCHMARK_BENCHMARK_G_TYPE:
2073 		g_value_set_gtype (value, self->priv->g_type);
2074 		break;
2075 		case GEE_BENCHMARK_BENCHMARK_G_DUP_FUNC:
2076 		g_value_set_pointer (value, self->priv->g_dup_func);
2077 		break;
2078 		case GEE_BENCHMARK_BENCHMARK_G_DESTROY_FUNC:
2079 		g_value_set_pointer (value, self->priv->g_destroy_func);
2080 		break;
2081 		default:
2082 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
2083 		break;
2084 	}
2085 }
2086 
2087 static void
_vala_gee_benchmark_benchmark_set_property(GObject * object,guint property_id,const GValue * value,GParamSpec * pspec)2088 _vala_gee_benchmark_benchmark_set_property (GObject * object,
2089                                             guint property_id,
2090                                             const GValue * value,
2091                                             GParamSpec * pspec)
2092 {
2093 	GeeBenchmarkBenchmark * self;
2094 	self = G_TYPE_CHECK_INSTANCE_CAST (object, GEE_BENCHMARK_TYPE_BENCHMARK, GeeBenchmarkBenchmark);
2095 	switch (property_id) {
2096 		case GEE_BENCHMARK_BENCHMARK_G_TYPE:
2097 		self->priv->g_type = g_value_get_gtype (value);
2098 		break;
2099 		case GEE_BENCHMARK_BENCHMARK_G_DUP_FUNC:
2100 		self->priv->g_dup_func = g_value_get_pointer (value);
2101 		break;
2102 		case GEE_BENCHMARK_BENCHMARK_G_DESTROY_FUNC:
2103 		self->priv->g_destroy_func = g_value_get_pointer (value);
2104 		break;
2105 		default:
2106 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
2107 		break;
2108 	}
2109 }
2110 
2111