convert pointer to integer before performing arithmetic

fixes mempool issues on platforms where sizeof(struct mempool) & ALIGN_MASK != 0