The single darray solution was potentially unsafe since you're not allowed to modify the (encode) buffer between calls to complex_input_data_proc which is potentially violated if the darray had to be resized due to capacity being < 2 * in_bytes_required