blob: 27b8f14e9afde5045951bd8aa7d8d3b9bb74b3d3 [file] [log] [blame]
Willy Tarreaubaaee002006-06-26 02:48:02 +02001/*
Willy Tarreaucc05fba2009-10-27 21:40:18 +01002 * include/common/config.h
3 * This files contains most of the user-configurable settings.
4 *
5 * Copyright (C) 2000-2009 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 */
Willy Tarreaubaaee002006-06-26 02:48:02 +020021
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 Tarreaucc05fba2009-10-27 21:40:18 +010025#include <common/compiler.h>
Willy Tarreau65d805f2014-07-15 18:05:58 +020026#include <common/compat.h>
Willy Tarreau2dd0d472006-06-29 17:53:05 +020027#include <common/defaults.h>
Willy Tarreaubaaee002006-06-26 02:48:02 +020028
29/* this reduces the number of calls to select() by choosing appropriate
30 * sheduler precision in milliseconds. It should be near the minimum
31 * time that is needed by select() to collect all events. All timeouts
32 * are rounded up by adding this value prior to pass it to select().
33 */
34#define SCHEDULER_RESOLUTION 9
35
Willy Tarreaue3ba5f02006-06-29 18:54:54 +020036/* CONFIG_HAP_MEM_OPTIM
37 * This enables use of memory pools instead of malloc()/free(). There
38 * is no reason to disable it, except perhaps for rare debugging.
39 */
40#ifndef CONFIG_HAP_NO_MEM_OPTIM
41# define CONFIG_HAP_MEM_OPTIM
42#endif /* CONFIG_HAP_NO_MEM_OPTIM */
43
Willy Tarreau50e608d2007-05-13 18:26:08 +020044/* CONFIG_HAP_MALLOC / CONFIG_HAP_CALLOC / CONFIG_HAP_FREE
45 * This macro allows to replace the malloc function with another one.
46 */
47#ifdef CONFIG_HAP_MALLOC
48#define MALLOC CONFIG_HAP_MALLOC
49#else
50#define MALLOC malloc
51#endif
52
53#ifdef CONFIG_HAP_CALLOC
54#define CALLOC CONFIG_HAP_CALLOC
55#else
56#define CALLOC calloc
57#endif
58
59#ifdef CONFIG_HAP_FREE
60#define FREE CONFIG_HAP_FREE
61#else
62#define FREE free
63#endif
64
Willy Tarreaue3ba5f02006-06-29 18:54:54 +020065
Willy Tarreau2a429502006-10-15 14:52:29 +020066/* CONFIG_HAP_INLINE_FD_SET
67 * This makes use of inline FD_* macros instead of calling equivalent
68 * functions. Benchmarks on a Pentium-M show that using functions is
69 * generally twice as fast. So it's better to keep this option unset.
70 */
71//#undef CONFIG_HAP_INLINE_FD_SET
72
Willy Tarreau2dd0d472006-06-29 17:53:05 +020073#endif /* _COMMON_CONFIG_H */