mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 11:34:38 +03:00
Fix compilation error with MSVC C++
This commit is contained in:
parent
7e743dfb58
commit
7f0137a617
5 changed files with 22 additions and 11 deletions
|
@ -489,6 +489,7 @@ void* mi_new(std::size_t n) noexcept(false) {
|
|||
else return mi_new_try(n);
|
||||
}
|
||||
|
||||
#if (__cplusplus > 201402L || defined(__cpp_aligned_new))
|
||||
// for aligned allocation its fine as it is not inlined anyways
|
||||
void* mi_new_aligned(std::size_t n, std::align_val_t alignment) noexcept(false) {
|
||||
void* p;
|
||||
|
@ -500,5 +501,6 @@ void* mi_new_aligned(std::size_t n, std::align_val_t alignment) noexcept(false)
|
|||
};
|
||||
return p;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -56,7 +56,7 @@ static inline uint8_t mi_bsr32(uint32_t x);
|
|||
#include <intrin.h>
|
||||
static inline uint8_t mi_bsr32(uint32_t x) {
|
||||
uint32_t idx;
|
||||
_BitScanReverse(&idx, x);
|
||||
_BitScanReverse((DWORD*)&idx, x);
|
||||
return idx;
|
||||
}
|
||||
#elif defined(__GNUC__) || defined(__clang__)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue