Browse Source

Bugfix: Resolving an issue with aligned memory allocation. Fixes #95

BearishSun 8 years ago
parent
commit
78b17cdd37
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Source/BansheeUtility/Allocators/BsMemoryAllocator.h

+ 1 - 1
Source/BansheeUtility/Allocators/BsMemoryAllocator.h

@@ -85,7 +85,7 @@ namespace bs
 			return nullptr;
 
 		UINT8* alignedData = ((UINT8*)data) + sizeof(void*);
-		alignedData += alignment - ((uintptr_t)alignedData) & (alignment - 1);
+		alignedData += (alignment - ((uintptr_t)alignedData) & (alignment - 1)) & (alignment - 1);
 
 		((void**)alignedData)[-1] = data;
 		return alignedData;