]> mj.ucw.cz Git - netgrind.git/blobdiff - lib/pools.c
Make pools 64-bit clean
[netgrind.git] / lib / pools.c
index 8b7c372518b232f1f28cf2bda6b2d43bf5264067..be42d43b9260115a255b7d2db5d5bccf1e8270dd 100644 (file)
@@ -69,7 +69,7 @@ mp_alloc(struct mempool *p, uns s)
 {
   if (s <= p->threshold)
     {
-      byte *x = (byte *)(((uns) p->free + POOL_ALIGN - 1) & ~(POOL_ALIGN - 1));
+      byte *x = (byte *)(((uintptr_t) p->free + POOL_ALIGN - 1) & ~((uintptr_t) POOL_ALIGN - 1));
       if (x + s > p->last)
        {
          struct memchunk *c;