mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 10:14:19 +01:00
MDEV-8868 Consider adding a check for libjemalloc version in cmake and/or at runtime
add a run-time check for jemalloc >= 2.3
This commit is contained in:
parent
6f0754789c
commit
581d85259d
1 changed files with 17 additions and 3 deletions
|
@ -356,9 +356,23 @@ static int tokudb_init_func(void *p) {
|
|||
tokudb_hton = (handlerton *) p;
|
||||
|
||||
#if TOKUDB_CHECK_JEMALLOC
|
||||
if (tokudb_check_jemalloc && dlsym(RTLD_DEFAULT, "mallctl") == NULL) {
|
||||
sql_print_error("%s is not initialized because jemalloc is not loaded", tokudb_hton_name);
|
||||
goto error;
|
||||
if (tokudb_check_jemalloc) {
|
||||
typedef int (*mallctl_type)(const char *, void *, size_t *, void *, size_t);
|
||||
mallctl_type mallctl_func;
|
||||
mallctl_func= (mallctl_type)dlsym(RTLD_DEFAULT, "mallctl");
|
||||
if (!mallctl_func) {
|
||||
sql_print_error("%s is not initialized because jemalloc is not loaded", tokudb_hton_name);
|
||||
goto error;
|
||||
}
|
||||
char *ver;
|
||||
size_t len= sizeof(ver);
|
||||
mallctl_func("version", &ver, &len, NULL, 0);
|
||||
/* jemalloc 2.2.5 crashes mysql-test */
|
||||
if (strcmp(ver, "2.3.") < 0) {
|
||||
sql_print_error("%s is not initialized because jemalloc is older than 2.3.0", tokudb_hton_name);
|
||||
goto error;
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue