Rename Align to AlignPtr

This commit is contained in:
Austin Eng
2017-07-14 18:53:07 -04:00
committed by Austin Eng
parent 0bcf0e8e74
commit 8867e5d8df
4 changed files with 14 additions and 13 deletions

View File

@@ -56,6 +56,7 @@ bool IsAligned(const void* ptr, size_t alignment) {
}
void* AlignVoidPtr(void* ptr, size_t alignment) {
ASSERT(IsPowerOfTwo(alignment));
ASSERT(alignment != 0);
return reinterpret_cast<void*>((reinterpret_cast<intptr_t>(ptr) + (alignment - 1)) & ~(alignment - 1));
}