blob: e8d8ad26bff67f10198a48b6d16a250c745add1f [file] [log] [blame]
Willy Tarreaubaaee002006-06-26 02:48:02 +02001/*
Willy Tarreau2dd0d472006-06-29 17:53:05 +02002 include/common/config.h
Willy Tarreaubaaee002006-06-26 02:48:02 +02003 This files contains most of the user-configurable settings.
4
5 Copyright (C) 2000-2006 Willy Tarreau - w@1wt.eu
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation, version 2.1
10 exclusively.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20*/
21
Willy Tarreau2dd0d472006-06-29 17:53:05 +020022#ifndef _COMMON_CONFIG_H
23#define _COMMON_CONFIG_H
Willy Tarreaubaaee002006-06-26 02:48:02 +020024
Willy Tarreau2dd0d472006-06-29 17:53:05 +020025#include <common/defaults.h>
Willy Tarreaubaaee002006-06-26 02:48:02 +020026
27/* this reduces the number of calls to select() by choosing appropriate
28 * sheduler precision in milliseconds. It should be near the minimum
29 * time that is needed by select() to collect all events. All timeouts
30 * are rounded up by adding this value prior to pass it to select().
31 */
32#define SCHEDULER_RESOLUTION 9
33
Willy Tarreaue3ba5f02006-06-29 18:54:54 +020034/* CONFIG_HAP_MEM_OPTIM
35 * This enables use of memory pools instead of malloc()/free(). There
36 * is no reason to disable it, except perhaps for rare debugging.
37 */
38#ifndef CONFIG_HAP_NO_MEM_OPTIM
39# define CONFIG_HAP_MEM_OPTIM
40#endif /* CONFIG_HAP_NO_MEM_OPTIM */
41
42
Willy Tarreau2a429502006-10-15 14:52:29 +020043/* CONFIG_HAP_INLINE_FD_SET
44 * This makes use of inline FD_* macros instead of calling equivalent
45 * functions. Benchmarks on a Pentium-M show that using functions is
46 * generally twice as fast. So it's better to keep this option unset.
47 */
48//#undef CONFIG_HAP_INLINE_FD_SET
49
Willy Tarreau390223b2006-10-15 23:43:42 +020050/* CONFIG_HAP_USE_REGPARM
51 * This enables the use of register parameters for some functions where
52 * it may improve performance by a measurable factor.
Willy Tarreaufb278672006-10-15 15:38:50 +020053 */
Willy Tarreau390223b2006-10-15 23:43:42 +020054#ifdef CONFIG_HAP_USE_REGPARM
Willy Tarreaufb278672006-10-15 15:38:50 +020055#define REGPRM1 __attribute__((regparm(1)))
56#define REGPRM2 __attribute__((regparm(2)))
57#define REGPRM3 __attribute__((regparm(3)))
Willy Tarreau390223b2006-10-15 23:43:42 +020058#else
59#define REGPRM1
60#define REGPRM2
61#define REGPRM3
Willy Tarreaufb278672006-10-15 15:38:50 +020062#endif
Willy Tarreau2a429502006-10-15 14:52:29 +020063
Willy Tarreau2dd0d472006-06-29 17:53:05 +020064#endif /* _COMMON_CONFIG_H */