u_prim_restart: add inline function for getting restart index based on index size