allocate p_flow arguments on heap and free immediately after creating a local copy inside p_flow