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

mimalloc 2.1.9 build failure with Visual Studio #984

Open
jabamaus opened this issue Jan 6, 2025 · 3 comments
Open

mimalloc 2.1.9 build failure with Visual Studio #984

jabamaus opened this issue Jan 6, 2025 · 3 comments

Comments

@jabamaus
Copy link

jabamaus commented Jan 6, 2025

VS2022 is complaining that mi_atomic_exchange_ptr_relaxed is not defined when _MSC_VER is defined. Looking at the definitions in atomic.h it seems that that is the case. Note that I am doing my own build without cmake but even so I can't see how mimalloc could ever compile...

1>segment-map.c 1>C:\james_projects\GitHub\jrf\libs\mimalloc\src\segment-map.c(131,30): warning C4013: 'mi_atomic_exchange_ptr_relaxed' undefined; assuming extern returning int 1>C:\james_projects\GitHub\jrf\libs\mimalloc\src\segment-map.c(131,61): error C2275: 'mi_segmap_part_t': expected an expression instead of a type 1>C:\james_projects\GitHub\jrf\libs\mimalloc\src\segment-map.c(131,23): warning C4047: 'initializing': 'mi_segmap_part_t *' differs in levels of indirection from 'int'

Thanks :)

@daanx
Copy link
Collaborator

daanx commented Jan 6, 2025

Yikes -- this is because in the IDE and cmake we always build in C++ mode with msvc. I have various special wrappers in atomic.h to enable C compilation on msvc as well but forgot the latest variants :-( I will update this and push a fresh release later this week (in case more issues pop up in the mean time).

Thanks!

@daanx
Copy link
Collaborator

daanx commented Jan 6, 2025

I think this is fixed (in dev for now) with commit 5764845 -- let me know if this works for you.

@jabamaus
Copy link
Author

jabamaus commented Jan 6, 2025

Yes that works. Thank you :)

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

2 participants