diff --git a/configure.ac b/configure.ac index e9091de..5740553 100644 --- a/configure.ac +++ b/configure.ac @@ -23,6 +23,13 @@ AS_IF([test "x$enable_build_examples" = "xyes"], [ AC_DEFINE([BUILD_EXAMPLES], 1, [build of examples enabled]) ]) +AC_ARG_ENABLE([faststack_alloc], + AS_HELP_STRING([--enable-faststack-alloc], [Use faststack thread-safe alloc within parser])) + +AS_IF([test "x$enable_faststack_alloc" = "xyes"], [ + AC_DEFINE([USE_FASTSTACK_ALLOC], 1, [using faststack allocation within parser]) +]) + AC_OUTPUT([ Makefile lib/libsexpr.pc diff --git a/lib/parser.c b/lib/parser.c index 996f03d..0c9e572 100644 --- a/lib/parser.c +++ b/lib/parser.c @@ -40,6 +40,12 @@ LA-CC-04-094 #include #include +#include + +#ifndef USE_FASTSTACK_ALLOC +#define _NO_MEMORY_MANAGEMENT_ 1 +#endif + /* we need a locks in this case and we don't have ability to change API */ #ifndef _NO_MEMORY_MANAGEMENT_ #include