2 mala_globals.c - Truely global variables (config vars)
4 Copyright (C) 2006, Christian Thaeter <chth@gmx.net>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License version 2 as
8 published by the Free Software Foundation.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, contact me.
21 Here are rarely needed fine-tuning configuration variables, most of them take
22 only effect when they are changed before a mala engine is initialized.
23 Some are const and only for compiletime configuration.
24 I try to keep reasonable defaults here, usually there should be no reason to change them.
28 #define MALA_GLOBAL(type, name, value) extern type mala_global_##name
29 #define MALA_GLOBAL_CONST(type, name, value) extern const type mala_global_##name
31 #define MALA_GLOBAL(type, name, value) type mala_global_##name = value
32 #define MALA_GLOBAL_CONST(type, name, value) const type mala_global_##name = value
36 * Garbagge Collector configuration
39 // how many objects, allocation frequency, performance impact
41 // few objects, static, noncritical
42 MALA_GLOBAL (unsigned, bucketfactory_low
, 50);
43 MALA_GLOBAL (unsigned, bucketfactory_high
, 70);
45 // many objects, dynamic, noncritical
46 MALA_GLOBAL (unsigned, stringsfactory_low
, 25);
47 MALA_GLOBAL (unsigned, stringsfactory_high
, 50);
49 // many objects, dynamic, noncritical
50 MALA_GLOBAL (unsigned, splayfactory_low
, 25);
51 MALA_GLOBAL (unsigned, splayfactory_high
, 50);
53 // many objects, very dynamic, critical
54 MALA_GLOBAL (unsigned, stringlistfactory_low
, 50);
55 MALA_GLOBAL (unsigned, stringlistfactory_high
, 90);
57 // some objects, mostly static, noncritical
58 MALA_GLOBAL (unsigned, actionfactory_low
, 10);
59 MALA_GLOBAL (unsigned, actionfactory_high
, 25);
61 // few objects, dynamic, noncritical
62 MALA_GLOBAL (unsigned, programfactory_low
, 25);
63 MALA_GLOBAL (unsigned, programfactory_high
, 75);
66 * probabilistic splay tree configuration
68 MALA_GLOBAL_CONST (unsigned, stringbucket_splay_zigzig
, 3);
69 MALA_GLOBAL_CONST (unsigned, stringbucket_splay_zigzag
, 0);
70 MALA_GLOBAL_CONST (unsigned, stringbucket_splay_zig
, 6);
73 * type identifiers for the acogc typesystem
75 MALA_GLOBAL_CONST (char*, type_stringbucket
, "mala_stringbucket");
76 MALA_GLOBAL_CONST (char*, type_string
, "mala_string");
77 MALA_GLOBAL_CONST (char*, type_stringbucketnode
, "mala_stringbucketnode");
78 MALA_GLOBAL_CONST (char*, type_stringlist
, "mala_stringlist");
79 MALA_GLOBAL_CONST (char*, type_action
, "mala_action");
80 MALA_GLOBAL_CONST (char*, type_program
, "mala_program");
86 // c-file-style: "gnu"
88 // arch-tag: 504325c1-cb9d-44b2-a407-a45e928d8792