Commit c8e6cb96 authored by Alexander Barkov's avatar Alexander Barkov

MDEV-4425 Regexp enhancements

Clean-up: moving initialization of my_string_stack_guard
and pcre_stack_guard into init_libstrings() and init_pcre().
parent 30ad3354
......@@ -3293,24 +3293,6 @@ void my_str_free_mysqld(void *ptr)
}
/*
Initialize my_str_malloc() and my_str_free()
*/
static void init_libstrings()
{
my_str_malloc= &my_str_malloc_mysqld;
my_str_free= &my_str_free_mysqld;
}
static void init_pcre()
{
pcre_malloc= pcre_stack_malloc= my_str_malloc_mysqld;
pcre_free= pcre_stack_free= my_str_free_mysqld;
}
#ifdef __WIN__
pthread_handler_t handle_shutdown(void *arg)
......@@ -3368,6 +3350,30 @@ check_enough_stack_size(int recurse_level)
#endif
/*
Initialize my_str_malloc() and my_str_free()
*/
static void init_libstrings()
{
my_str_malloc= &my_str_malloc_mysqld;
my_str_free= &my_str_free_mysqld;
#ifndef EMBEDDED_LIBRARY
my_string_stack_guard= check_enough_stack_size;
#endif
}
static void init_pcre()
{
pcre_malloc= pcre_stack_malloc= my_str_malloc_mysqld;
pcre_free= pcre_stack_free= my_str_free_mysqld;
#ifndef EMBEDDED_LIBRARY
pcre_stack_guard= check_enough_stack_size_slow;
#endif
}
/**
Initialize one of the global date/time format variables.
......@@ -3928,10 +3934,6 @@ static int init_common_variables()
return 1;
item_init();
init_pcre();
#ifndef EMBEDDED_LIBRARY
my_string_stack_guard= check_enough_stack_size;
pcre_stack_guard= check_enough_stack_size_slow;
#endif
/*
Process a comma-separated character set list and choose
the first available character set. This is mostly for
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment