Ensure that any allocation held by the given SIValue is guaranteed to not go out * of scope during the lifetime of this query by copying references to volatile memory. * Heap allocations that are not scoped to the input SIValue, such as strings from the AST * or a GraphEntity property, are not modified. */
| 203 | * Heap allocations that are not scoped to the input SIValue, such as strings from the AST |
| 204 | * or a GraphEntity property, are not modified. */ |
| 205 | void SIValue_Persist(SIValue *v) { |
| 206 | // do nothing for non-volatile values |
| 207 | // for volatile values, persisting uses the same logic as cloning |
| 208 | if(v->allocation == M_VOLATILE) *v = SI_CloneValue(*v); |
| 209 | } |
| 210 | |
| 211 | /* Update an SIValue's allocation type to the provided value. */ |
| 212 | inline void SIValue_SetAllocationType(SIValue *v, SIAllocation allocation) { |
no test coverage detected