When the state variable has space for adding the new span set, the function returns the current state variable. Otherwise, a NEW state variable is returned and the input state is freed.
Note
Always use the function to overwrite the existing state as in: