RF_ALIGNMENT_LOG2
flags = (flags & ~RF_ALIGNMENT_MASK) | RF_ALIGNMENT_LOG2(mapsize);
return(RF_ALIGNMENT_LOG2(i));