The dash array is always small, there's no reason to allocate it on the heap, you can store an array in the pen object.
Ok
Also there shouldn't be any need to store the 'ext' flag if you take it into account when building the array.
You need that flag to help choosing between LineOnOffDash and LineDoubleDash in X11DRV_SetupGCForPen.