Using array modifier to array an object between 2 curves
You can use Array Modifier's Fit Length or Fit Curve options


Fit Length - specify a maximum length of arrayed objects (use the length slider)
Fit Curve - use a curve to determine the length (adjust the curve to control length)