mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +00:00
Use _mm_malloc on _WIN32
This commit is contained in:
parent
a6c614da03
commit
a8bdf69c71
1 changed files with 4 additions and 8 deletions
12
src/misc.cpp
12
src/misc.cpp
|
@ -41,10 +41,6 @@ typedef bool(*fun3_t)(HANDLE, CONST GROUP_AFFINITY*, PGROUP_AFFINITY);
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#include <fstream>
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
|
@ -305,8 +301,8 @@ void prefetch(void* addr) {
|
|||
void* std_aligned_alloc(size_t alignment, size_t size) {
|
||||
#if defined(__APPLE__)
|
||||
return aligned_alloc(alignment, size);
|
||||
#elif defined(_MSC_VER)
|
||||
return _aligned_alloc(size, alignment);
|
||||
#elif defined(_WIN32)
|
||||
return _mm_malloc(size, alignment);
|
||||
#else
|
||||
return std::aligned_alloc(alignment, size);
|
||||
#endif
|
||||
|
@ -315,8 +311,8 @@ void* std_aligned_alloc(size_t alignment, size_t size) {
|
|||
void std_aligned_free(void* ptr) {
|
||||
#if defined(__APPLE__)
|
||||
free(ptr);
|
||||
#elif defined(_MSC_VER)
|
||||
_aligned_free(ptr);
|
||||
#elif defined(_WIN32)
|
||||
_mm_free(ptr);
|
||||
#else
|
||||
free(ptr);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue