diff --git a/CHANGELOG.md b/CHANGELOG.md index 900a83b8..90f24e09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,8 @@ ### Changed - 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 diff --git a/include/reactphysics3d/memory/DefaultAllocator.h b/include/reactphysics3d/memory/DefaultAllocator.h index 727b07b2..521e684a 100644 --- a/include/reactphysics3d/memory/DefaultAllocator.h +++ b/include/reactphysics3d/memory/DefaultAllocator.h @@ -59,8 +59,8 @@ class DefaultAllocator : public MemoryAllocator { // If compiler is Visual Studio #ifdef RP3D_COMPILER_VISUAL_STUDIO - // Visual Studio doesn't not support standard std:aligned_alloc() method from c++ 17 - return _alligned_malloc(size, GLOBAL_ALIGNMENT); + // Visual Studio doesn't not support standard std:aligned_alloc() method from C++ 17 + return _aligned_malloc(size, GLOBAL_ALIGNMENT); #else // Return 16-bytes aligned memory @@ -75,7 +75,7 @@ class DefaultAllocator : public MemoryAllocator { #ifdef RP3D_COMPILER_VISUAL_STUDIO // 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 return std::free(pointer);