4 #include "mono/utils/mono-lazy-init.h"
5 #include "mono/utils/mono-experiments.h"
7 mono_lazy_init_t mono_experiments_enabled_init
;
9 guint8 mono_experiments_enabled_table
[] = {
10 #define EXPERIMENT(id,ghurl) 0,
11 #include "mono-experiments.def"
16 const char* mono_experiment_names
[] = {
17 #define EXPERIMENT(id,ghurl) #id,
18 #include "mono-experiments.def"
23 lookup_experiment_by_name (const char *exp_name
)
25 /* slow loop, but we only do this once, on demand. */
26 for (int i
= 0; i
< MONO_EXPERIMENT_NUM_EXPERIMENTS
; i
++) {
27 if (!strcmp (mono_experiment_names
[i
], exp_name
))
34 mono_experiments_initialize_table (void)
36 char *str
= g_getenv ("MONO_EXPERIMENT");
39 char **experiments
= g_strsplit (str
, ",", 0);
41 char **exp_name
= &experiments
[0];
43 int exp_id
= lookup_experiment_by_name (*exp_name
);
45 g_warning ("This version of Mono does not include experiment '%s'. Experiments have no stability, backward compatability or deprecation guarantees.", *exp_name
);
47 mono_experiments_enabled_table
[exp_id
] = 1;
53 g_strfreev (experiments
);