mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2025-03-21 22:07:03 +00:00
Add compile-time option to enable 4-way tries instead of 16-way ones
In some cases 16-way tries are too memory-heavy, while 4-way are almost as efficient as the original 2-way ones.
This commit is contained in:
parent
6d1ae197d1
commit
d3f50ede12
11
configure.ac
11
configure.ac
@ -36,6 +36,12 @@ AC_ARG_ENABLE([memcheck],
|
|||||||
[enable_memcheck=yes]
|
[enable_memcheck=yes]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
AC_ARG_ENABLE([compact-tries],
|
||||||
|
[AS_HELP_STRING([--enable-compact-tries], [use 4-way tries instead of 16-way ones @<:@no@:>@])],
|
||||||
|
[],
|
||||||
|
[enable_compact_tries=no]
|
||||||
|
)
|
||||||
|
|
||||||
AC_ARG_ENABLE([pthreads],
|
AC_ARG_ENABLE([pthreads],
|
||||||
[AS_HELP_STRING([--enable-pthreads], [enable POSIX threads support @<:@try@:>@])],
|
[AS_HELP_STRING([--enable-pthreads], [enable POSIX threads support @<:@try@:>@])],
|
||||||
[],
|
[],
|
||||||
@ -409,6 +415,10 @@ if test "$enable_debug" = yes ; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test "$enable_compact_tries" = yes ; then
|
||||||
|
AC_DEFINE([ENABLE_COMPACT_TRIES], [1], [Define to 1 if you want 4-way tries instead of 16-way ones.])
|
||||||
|
fi
|
||||||
|
|
||||||
CLIENT=birdcl
|
CLIENT=birdcl
|
||||||
CLIENT_LIBS=
|
CLIENT_LIBS=
|
||||||
if test "$enable_client" = yes ; then
|
if test "$enable_client" = yes ; then
|
||||||
@ -469,6 +479,7 @@ AC_MSG_RESULT([ Object directory: $objdir])
|
|||||||
AC_MSG_RESULT([ Iproute2 directory: $iproutedir])
|
AC_MSG_RESULT([ Iproute2 directory: $iproutedir])
|
||||||
AC_MSG_RESULT([ System configuration: $sysdesc])
|
AC_MSG_RESULT([ System configuration: $sysdesc])
|
||||||
AC_MSG_RESULT([ Debugging: $enable_debug])
|
AC_MSG_RESULT([ Debugging: $enable_debug])
|
||||||
|
AC_MSG_RESULT([ Compact tries: $enable_compact_tries])
|
||||||
AC_MSG_RESULT([ POSIX threads: $enable_pthreads])
|
AC_MSG_RESULT([ POSIX threads: $enable_pthreads])
|
||||||
AC_MSG_RESULT([ Routing protocols: $protocols])
|
AC_MSG_RESULT([ Routing protocols: $protocols])
|
||||||
AC_MSG_RESULT([ LibSSH support in RPKI: $enable_libssh])
|
AC_MSG_RESULT([ LibSSH support in RPKI: $enable_libssh])
|
||||||
|
@ -141,8 +141,15 @@ struct f_tree {
|
|||||||
void *data;
|
void *data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef ENABLE_COMPACT_TRIES
|
||||||
|
/* Compact 4-way tries */
|
||||||
|
#define TRIE_STEP 2
|
||||||
|
#define TRIE_STACK_LENGTH 65
|
||||||
|
#else
|
||||||
|
/* Faster 16-way tries */
|
||||||
#define TRIE_STEP 4
|
#define TRIE_STEP 4
|
||||||
#define TRIE_STACK_LENGTH 33
|
#define TRIE_STACK_LENGTH 33
|
||||||
|
#endif
|
||||||
|
|
||||||
struct f_trie_node4
|
struct f_trie_node4
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user