fixed compilation on freebsd releases witout log2 function

fixed compilation on freebsd releases witout log2 function