added align16() function
This commit is contained in:
@@ -38,6 +38,22 @@
|
|||||||
|
|
||||||
#define Elements(x) sizeof(x)/sizeof(*(x))
|
#define Elements(x) sizeof(x)/sizeof(*(x))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return pointer aligned to next multiple of 16 bytes.
|
||||||
|
*/
|
||||||
|
static INLINE void *
|
||||||
|
align16(void *unaligned)
|
||||||
|
{
|
||||||
|
union {
|
||||||
|
void *p;
|
||||||
|
uint64 u;
|
||||||
|
} pu;
|
||||||
|
pu.p = unaligned;
|
||||||
|
pu.u = (pu.u + 15) & ~15;
|
||||||
|
return pu.p;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#if defined(__MSC__) && defined(__WIN32__)
|
#if defined(__MSC__) && defined(__WIN32__)
|
||||||
static INLINE unsigned ffs( unsigned u )
|
static INLINE unsigned ffs( unsigned u )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user