Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent output naming of mimalloc.dll #903

Open
AlifianK opened this issue May 29, 2024 · 4 comments
Open

Inconsistent output naming of mimalloc.dll #903

AlifianK opened this issue May 29, 2024 · 4 comments

Comments

@AlifianK
Copy link

AlifianK commented May 29, 2024

After updating to v2.1.7, mimalloc-redirect.dll requires mimalloc-override.dll. While this is consistent with readme instruction, the names of the DLL objects after compiling are still mimalloc.dll and mimalloc-redirect.dll inside the build folder, which requires me to rename mimalloc.dll to mimalloc-override.dll manually. So either change back the mimalloc-redirect.dll linking to mimalloc.dll, or change mimalloc.dll output to mimalloc-override.dll.

@daanx
Copy link
Collaborator

daanx commented May 31, 2024

To clarify mimalloc-override.dll requires mimalloc-redirect.dll (and your main program should have a dependency on mimalloc-override.dll.

When I look at CMakeLists.txt I see nowhere that mimalloc-override.dll is created -- that seems wrong but already it seems to have been wrong for a while? Did you have it working on an earlier version? I need to think a bit for the best fix.

@AlifianK
Copy link
Author

AlifianK commented May 31, 2024

Yes, but I'm not sure what changed.
I tried playing around with past release, I tested v2.1.2 and the error is like this
image

While the latest version (v2.1.7) is like this
image

I think the name has been wrong since I started using mimalloc, but it was working so I assumed it was just outdated documentation on readme section, but the issue started to appear on the latest release, that's why I filed this issue, Meanwhile I patched CMakeLists.txt with this, and the output will correctly produce mimalloc-override.dll.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index bcfe91d8..67dce36f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -401,7 +401,7 @@ else()
   set(mi_install_cmakedir   "${CMAKE_INSTALL_LIBDIR}/cmake/mimalloc-${mi_version}") # for cmake package info
 endif()

-set(mi_basename "mimalloc")
+set(mi_basename "mimalloc-override")
 if(MI_SECURE)
   set(mi_basename "${mi_basename}-secure")
 endif()

Edit: To clarify, I used minject to import the dependencies. I don't link mimalloc when compiling the program.

@daanx
Copy link
Collaborator

daanx commented Jun 5, 2024

Thanks for the clarification; I usually use the visual studio IDE and there we do produce the mimalloc-override.dll . I am hesitant to change things in the cmake to avoid breaking build scripts ... I'll experiment a bit more... tbc.

@martingalvan-volue
Copy link

Hi, I'm having a similar issue where the mimalloc DLL will be called mimalloc.dll when built through CMake (by installing it with vcpkg). This happens even though I'm using the override feature of the mimalloc vcpkg port.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants