Commit 3a78ccab authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

#4267 use RTLD_DEFAULT in calls to dlsym per the man page closes[t:4267]

git-svn-id: file:///svn/toku/tokudb@37852 c7de825b-a66e-492c-adef-691d508d4ae1
parent 26e61965
......@@ -36,7 +36,7 @@ toku_memory_startup(void) {
// to get version and mmap threshold configuration.
typedef int (*mallctl_fun_t)(const char *, void *, size_t *, void *, size_t);
mallctl_fun_t mallctl_f;
mallctl_f = (mallctl_fun_t) dlsym(NULL, "mallctl");
mallctl_f = (mallctl_fun_t) dlsym(RTLD_DEFAULT, "mallctl");
if (mallctl_f) { // jemalloc is loaded
size_t version_length = sizeof status.mallocator_version;
result = mallctl_f("version", &status.mallocator_version, &version_length, NULL, 0);
......
......@@ -2,8 +2,11 @@
#include "memory.h"
int main(void) {
toku_memory_startup();
MEMORY_STATUS_S s;
toku_memory_get_status(&s);
printf("tokudb mallocator: %s\n", s.mallocator_version);
printf("mallocator: %s\n", s.mallocator_version);
printf("mmap threshold: %" PRIu64 "\n", s.mmap_threshold);
toku_memory_shutdown();
return 0;
}
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