rlmesh_episode_state_set
On RLMESH_OK value (and free_value, NULL = none) pass to the state, and replacing a key frees the old value first; on nonzero free_value is not called, the caller still owns value, and the state is unchanged. Re-setting the same pointer keeps the value alive and updates its free function without calling the previous one.
RLMeshStatus rlmesh_episode_state_set(
RLMeshEpisodeState* episode_state,
const char* key,
void* value,
void (*free_value)(void* value)
)