pointer: add uintptr align function

This commit is contained in:
Danny Robson 2016-03-11 09:40:12 +11:00
parent b7973dacd4
commit 191268d38b

View File

@ -32,6 +32,16 @@ namespace util {
ptr += alignment - ptr % alignment;
return reinterpret_cast<T*> (ptr);
}
//-------------------------------------------------------------------------
inline uintptr_t
align (uintptr_t ptr, size_t alignment)
{
return reinterpret_cast<uintptr_t> (
align (reinterpret_cast<void*> (ptr), alignment)
);
}
}
#endif