Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 1 | /* |
Willy Tarreau | cc05fba | 2009-10-27 21:40:18 +0100 | [diff] [blame] | 2 | * 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 Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 21 | |
Willy Tarreau | 2dd0d47 | 2006-06-29 17:53:05 +0200 | [diff] [blame] | 22 | #ifndef _COMMON_CONFIG_H |
| 23 | #define _COMMON_CONFIG_H |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 24 | |
Willy Tarreau | cc05fba | 2009-10-27 21:40:18 +0100 | [diff] [blame] | 25 | #include <common/compiler.h> |
Willy Tarreau | 2dd0d47 | 2006-06-29 17:53:05 +0200 | [diff] [blame] | 26 | #include <common/defaults.h> |
Willy Tarreau | baaee00 | 2006-06-26 02:48:02 +0200 | [diff] [blame] | 27 | |
| 28 | /* this reduces the number of calls to select() by choosing appropriate |
| 29 | * sheduler precision in milliseconds. It should be near the minimum |
| 30 | * time that is needed by select() to collect all events. All timeouts |
| 31 | * are rounded up by adding this value prior to pass it to select(). |
| 32 | */ |
| 33 | #define SCHEDULER_RESOLUTION 9 |
| 34 | |
Willy Tarreau | e3ba5f0 | 2006-06-29 18:54:54 +0200 | [diff] [blame] | 35 | /* CONFIG_HAP_MEM_OPTIM |
| 36 | * This enables use of memory pools instead of malloc()/free(). There |
| 37 | * is no reason to disable it, except perhaps for rare debugging. |
| 38 | */ |
| 39 | #ifndef CONFIG_HAP_NO_MEM_OPTIM |
| 40 | # define CONFIG_HAP_MEM_OPTIM |
| 41 | #endif /* CONFIG_HAP_NO_MEM_OPTIM */ |
| 42 | |
Willy Tarreau | 50e608d | 2007-05-13 18:26:08 +0200 | [diff] [blame] | 43 | /* CONFIG_HAP_MALLOC / CONFIG_HAP_CALLOC / CONFIG_HAP_FREE |
| 44 | * This macro allows to replace the malloc function with another one. |
| 45 | */ |
| 46 | #ifdef CONFIG_HAP_MALLOC |
| 47 | #define MALLOC CONFIG_HAP_MALLOC |
| 48 | #else |
| 49 | #define MALLOC malloc |
| 50 | #endif |
| 51 | |
| 52 | #ifdef CONFIG_HAP_CALLOC |
| 53 | #define CALLOC CONFIG_HAP_CALLOC |
| 54 | #else |
| 55 | #define CALLOC calloc |
| 56 | #endif |
| 57 | |
| 58 | #ifdef CONFIG_HAP_FREE |
| 59 | #define FREE CONFIG_HAP_FREE |
| 60 | #else |
| 61 | #define FREE free |
| 62 | #endif |
| 63 | |
Willy Tarreau | e3ba5f0 | 2006-06-29 18:54:54 +0200 | [diff] [blame] | 64 | |
Willy Tarreau | 2a42950 | 2006-10-15 14:52:29 +0200 | [diff] [blame] | 65 | /* CONFIG_HAP_INLINE_FD_SET |
| 66 | * This makes use of inline FD_* macros instead of calling equivalent |
| 67 | * functions. Benchmarks on a Pentium-M show that using functions is |
| 68 | * generally twice as fast. So it's better to keep this option unset. |
| 69 | */ |
| 70 | //#undef CONFIG_HAP_INLINE_FD_SET |
| 71 | |
Willy Tarreau | 2dd0d47 | 2006-06-29 17:53:05 +0200 | [diff] [blame] | 72 | #endif /* _COMMON_CONFIG_H */ |