SERVER-80619 update bazel cc_binary definition to use tcmalloc conditionally
This commit is contained in:
committed by
Evergreen Agent
parent
c8b05bb038
commit
bb49fa800f
@@ -1,8 +1,20 @@
|
||||
// C++ compilation file used for testing bazel compilation.
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <iostream>
|
||||
|
||||
int main() {
|
||||
printf("Hello World!\n");
|
||||
void* tcmalloc_so = dlopen(
|
||||
"/home/ubuntu/mongo/bazel-bin/_solib_arm64/"
|
||||
"libsrc_Sthird_Uparty_Sgperftools_Slibtcmalloc_Uminimal.so",
|
||||
RTLD_NOW);
|
||||
void* tcmalloc = dlsym(tcmalloc_so, "malloc");
|
||||
|
||||
void* libcmalloc_so = dlopen("/lib/aarch64-linux-gnu/libc.so.6", RTLD_NOW);
|
||||
void* libcmalloc = dlsym(libcmalloc_so, "malloc");
|
||||
|
||||
printf("%p [unit test malloc]\n", malloc);
|
||||
printf("%p [tcmalloc]\n", tcmalloc);
|
||||
printf("%p [libc malloc]\n", libcmalloc);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user