seperated is_valid and is_in_bound for mmap call.