Commit 7960e0bd authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add some semi-magic functions to align pointers with.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4657 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 35d81961
......@@ -95,6 +95,15 @@ struct lock { void *priv; }; // Opaque
#define DIGEST_LEN 32
/*--------------------------------------------------------------------
* Pointer aligment magic
*/
#define PALGN (sizeof(void *) - 1)
#define PAOK(p) (((uintptr_t)(p) & PALGN) == 0)
#define PRNDDN(p) ((uintptr_t)(p) & ~PALGN)
#define PRNDUP(p) (((uintptr_t)(p) + PALGN) & ~PALGN)
/*--------------------------------------------------------------------*/
typedef struct {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment