move src_ext len to global to cache it