[clang] Add DllMain entry point to `libclang.dll` (PR #171465)
Hans Wennborg via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 9 08:33:37 PST 2025
================
@@ -0,0 +1,24 @@
+
+
+#include <windows.h>
+
+extern "C" {
+
+int rpmalloc_initialize(void);
+void rpmalloc_finalize(void);
+void rpmalloc_thread_initialize(void);
+void rpmalloc_thread_finalize(int release_caches);
+
+BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved) {
+ if (reason == DLL_PROCESS_ATTACH) {
+ rpmalloc_initialize();
+ } else if (reason == DLL_PROCESS_DETACH) {
----------------
zmodem wrote:
Since we build rpmalloc with `ENABLE_PRELOAD`, I think we already call `_global_rpmalloc_init()` at load time, so maybe we shouldn't be doing the initialization calls here?
https://github.com/llvm/llvm-project/pull/171465
More information about the cfe-commits
mailing list