Commit 5752890
Add shared ownership to
This change introduces `tstring::owner<T>`, a reference-counted wrapper for an object `T`. `tstring` can now be assigned a "shared view" using `assign_as_shared_view`, where the underlying data is owned by a `tstring::owner`. The `tstring` will increment the owner's reference count and decrement it when the `tstring` is deallocated or reassigned, ensuring the owner object remains alive as long as any `tstring` holds a shared view to its data. This is implemented by adding a `TStringOwnerCApi` pointer to the `TF_TString_View` struct and updating the relevant `TF_TString` functions to handle the reference counting.
PiperOrigin-RevId: 832101409tstring's VIEW type.1 parent 90ef1fa commit 5752890
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
418 | 418 | | |
419 | 419 | | |
420 | 420 | | |
421 | | - | |
| 421 | + | |
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
| |||
0 commit comments