Skip to content
Permalink
Browse files
Fixed compiler warnings in guess_malloc_library
  • Loading branch information
montywi committed Dec 22, 2017
1 parent d9e9029 commit 1d9fd4f
Showing 1 changed file with 7 additions and 6 deletions.
@@ -21,8 +21,13 @@
#include "my_global.h"
#include <m_string.h>

typedef const char* (*tc_version_type)(int*, int*, const char**);
typedef int (*mallctl_type)(const char*, void*, size_t*, void*, size_t);

char *guess_malloc_library()
{
tc_version_type tc_version_func;
mallctl_type mallctl_func;
#ifndef HAVE_DLOPEN
return (char*) MALLOC_LIBRARY;
#else
@@ -34,9 +39,7 @@ char *guess_malloc_library()
}

/* tcmalloc */
typedef const char* (*tc_version_type)(int*, int*, const char**);
tc_version_type tc_version_func =
(tc_version_type) dlsym(RTLD_DEFAULT, "tc_version");
tc_version_func= (tc_version_type) dlsym(RTLD_DEFAULT, "tc_version");
if (tc_version_func)
{
int major, minor;
@@ -46,9 +49,7 @@ char *guess_malloc_library()
}

/* jemalloc */
typedef int (*mallctl_type)(const char*, void*, size_t*, void*, size_t);
mallctl_type mallctl_func =
(mallctl_type) dlsym(RTLD_DEFAULT, "mallctl");
mallctl_func= (mallctl_type) dlsym(RTLD_DEFAULT, "mallctl");
if (mallctl_func)
{
char *ver;

0 comments on commit 1d9fd4f

Please sign in to comment.