--- parser3/src/main/pa_globals.C 2020/12/15 00:21:33 1.210 +++ parser3/src/main/pa_globals.C 2024/11/11 05:28:00 1.216 @@ -1,8 +1,8 @@ /** @file Parser: globals. - Copyright (c) 2001-2017 Art. Lebedev Studio (http://www.artlebedev.com) - Author: Alexandr Petrosian (http://paf.design.ru) + Copyright (c) 2001-2024 Art. Lebedev Studio (http://www.artlebedev.com) + Authors: Konstantin Morshnev , Alexandr Petrosian */ #include "pa_config_includes.h" @@ -19,7 +19,6 @@ extern "C" { #include "pa_globals.h" #include "pa_socks.h" #include "pa_sapi.h" -#include "pa_threads.h" #include "pa_xml_io.h" #include "pa_common.h" #include "pa_symbols.h" @@ -27,9 +26,9 @@ extern "C" { #include "pa_cache_managers.h" #include "ltdl.h" -#include "pcre.h" +#include "pa_vregex.h" -volatile const char * IDENT_PA_GLOBALS_C="$Id: pa_globals.C,v 1.210 2020/12/15 00:21:33 moko Exp $" IDENT_PA_GLOBALS_H IDENT_PA_SAPI_H; +volatile const char * IDENT_PA_GLOBALS_C="$Id: pa_globals.C,v 1.216 2024/11/11 05:28:00 moko Exp $" IDENT_PA_GLOBALS_H IDENT_PA_SAPI_H; // defines @@ -178,6 +177,19 @@ static void pa_gc_free_maybeignore(void* #endif // XML +#ifdef HAVE_PCRE2 +pcre2_general_context* VRegex::fgen_ctxt; + +static void* pa_pcre_malloc(size_t size, void *ptr){ + return pa_malloc(size); +} + +static void pa_pcre_free(void *ptr, void *tag){ + pa_free(ptr); +} +#endif + + void pa_CORD_oom_fn(void) { pa_fail_alloc("expand string", 0); } @@ -208,8 +220,12 @@ static void gc_substitute_memory_managem #endif // pcre +#ifdef HAVE_PCRE2 + VRegex::fgen_ctxt=pcre2_general_context_create(pa_pcre_malloc, pa_pcre_free, NULL); +#else pcre_malloc=pa_malloc; pcre_free=pa_free; +#endif // cord CORD_oom_fn=pa_CORD_oom_fn; @@ -286,6 +302,9 @@ void pa_globals_init() { pa_xml_io_init(); #endif + + // init *_class variables + methoded_array(); } static bool is_dlinited=false;