You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The getting started wiki provides a nice example which assumes that mangling is enabled:
#include <stdlib.h>
#include <jemalloc/jemalloc.h>
void
do_something(size_t i) {
// Leak some memory.
malloc(i * 100);
}
int
main(int argc, char **argv) {
for (size_t i = 0; i < 1000; i++) {
do_something(i);
}
// Dump allocator statistics to stderr.
malloc_stats_print(NULL, NULL, NULL);
return 0;
}
It seems this would only compile successfully if JEMALLOC_MANGLE is set (malloc_stats_print by default is only available using the prefix je_malloc_stats_print).
It would be helpful to a note in the wiki regarding how to turn on mangling for your compilation (either by providing the -DJEMALLOC_MANGLE flag in the compilation command or setting the define in the configure step) :)
The text was updated successfully, but these errors were encountered:
The getting started wiki provides a nice example which assumes that mangling is enabled:
It seems this would only compile successfully if JEMALLOC_MANGLE is set (malloc_stats_print by default is only available using the prefix je_malloc_stats_print).
It would be helpful to a note in the wiki regarding how to turn on mangling for your compilation (either by providing the -DJEMALLOC_MANGLE flag in the compilation command or setting the define in the configure step) :)
The text was updated successfully, but these errors were encountered: