소스 검색

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

BearishSun 8 년 전
부모
커밋
78b17cdd37
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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;