Skip to content

Conversation

@mkurdej
Copy link
Contributor

@mkurdej mkurdej commented May 4, 2021

This fixes the use of mimalloc on 32-bit Windows when building with CMake.
Without it, one would get link errors like:

      init.obj error LNK2019: unresolved external symbol __imp__mi_allocator_init referenced in function "void __cdecl mi_process_load(void)" (?mi_process_load@@YAXXZ)
10:58:29
      init.obj error LNK2019: unresolved external symbol __imp__mi_allocator_done referenced in function "void __cdecl mi_process_done(void)" (?mi_process_done@@YAXXZ)
10:58:29
      ..\..\..\..\thirdparty\mimalloc\bin\mimalloc-redirect.lib warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86'

because it would try to link bin\mimalloc-redirect.lib (64-bit) to a 32-bit mimalloc.dll.

Also, without this patch, bin\mimalloc-redirect32.{lib,dll} are unused in CMake, they are used though in .vcxproj files.

@mkurdej mkurdej changed the title [Windows] Correctly choose 32-bit version of mimalloc-redirect{,32}.dll. [Windows] Correctly choose 32-bit version of mimalloc-redirect{,32}.dll in CMake. May 4, 2021
@daanx daanx changed the base branch from master to dev May 21, 2021 19:17
@daanx
Copy link
Collaborator

daanx commented May 21, 2021

Great, thanks so much

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

Successfully merging this pull request may close these issues.

2 participants