Fix compilation issue with Visual Studio
This commit is contained in:
parent
0d18610298
commit
8b18ee22f3
|
@ -7,7 +7,8 @@
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- The library must now be compiled with C++ 17 compiler
|
- The library must now be compiled with C++ 17 compiler
|
||||||
- If the user sets its custom allocator, the return allocated memory must now be 16 bytes aligned
|
- If the user sets its own custom allocator, the return allocated memory must now be 16 bytes aligned
|
||||||
|
- The internal allocators now allocates memory that is 16-bytes aligned
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
|
|
|
@ -59,8 +59,8 @@ class DefaultAllocator : public MemoryAllocator {
|
||||||
// If compiler is Visual Studio
|
// If compiler is Visual Studio
|
||||||
#ifdef RP3D_COMPILER_VISUAL_STUDIO
|
#ifdef RP3D_COMPILER_VISUAL_STUDIO
|
||||||
|
|
||||||
// Visual Studio doesn't not support standard std:aligned_alloc() method from c++ 17
|
// Visual Studio doesn't not support standard std:aligned_alloc() method from C++ 17
|
||||||
return _alligned_malloc(size, GLOBAL_ALIGNMENT);
|
return _aligned_malloc(size, GLOBAL_ALIGNMENT);
|
||||||
#else
|
#else
|
||||||
|
|
||||||
// Return 16-bytes aligned memory
|
// Return 16-bytes aligned memory
|
||||||
|
@ -75,7 +75,7 @@ class DefaultAllocator : public MemoryAllocator {
|
||||||
#ifdef RP3D_COMPILER_VISUAL_STUDIO
|
#ifdef RP3D_COMPILER_VISUAL_STUDIO
|
||||||
|
|
||||||
// Visual Studio doesn't not support standard std:aligned_alloc() method from c++ 17
|
// Visual Studio doesn't not support standard std:aligned_alloc() method from c++ 17
|
||||||
return _aligned_free(GLOBAL_ALIGNMENT, pointer);
|
return _aligned_free(pointer);
|
||||||
#else
|
#else
|
||||||
|
|
||||||
return std::free(pointer);
|
return std::free(pointer);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user