Make an SIValue that reuses the original's allocations, if any. * The returned value is not responsible for freeing any allocations, * and is not guaranteed that these allocations will remain in scope. */
| 122 | * The returned value is not responsible for freeing any allocations, |
| 123 | * and is not guaranteed that these allocations will remain in scope. */ |
| 124 | SIValue SI_ShareValue(const SIValue v) { |
| 125 | SIValue dup = v; |
| 126 | // If the original value owns an allocation, mark that the duplicate shares it. |
| 127 | if(v.allocation == M_SELF) dup.allocation = M_VOLATILE; |
| 128 | return dup; |
| 129 | } |
| 130 | |
| 131 | /* Make an SIValue that creates its own copies of the original's allocations, if any. |
| 132 | * This is not a deep clone: if the inner value holds its own references, |
no outgoing calls
no test coverage detected