-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
SharedPtr
, an efficient non-intrusive shared pointer.
Rename `RefCountedPtr` to `IntrusiveSharedPtr` to highlight a relationship to `SharedPtr`. Migrate most usages of `IntrusiveSharedPtr` to `SharedPtr`. Deprecate `RefCountedBase`. It has no more usages in Riegeli. Almost all usages of `RefCountedPtr` which rely on `RefCountedBase` for intrusive reference counting can be migrated to `SharedPtr` instead of `IntrusiveSharedPtr`. Split `intrusive_ref_count.h` to `ref_count.h`, `shared_ptr.h`, and `intrusive_shared_ptr.h`. Rename member functions from std style to Google style: * `reset()` → `Reset()` * `release()` → `Release()` * `has_unique_owner()` → `HasUniqueOwner()` Deprecate `MakeRefCounted()`. Construct the object held by `{,Intrusive}SharedPtr` using a constructor from `Initializer`. As a bonus, `Reset()` from `Initializer` can assign to an existing object if possible. Minor changes to the API: * Add a direct definition of `IntrusiveSharedPtr::operator=(std::nullptr_t)` to complement the implicit conversion. * Add `IntrusiveSharedPtr::IsUnique()` for consistency with `SharedPtr`. * Remove `IntrusiveSharedPtr::exchange()`. `std::exchange()` is equally efficient. * Support heterogeneous equality. * Rename `{,Sized}SharedBuffer::has_unique_owner()` to `IsUnique()`. In compression dictionaries and `CsvHeader`, simplify code by using `Initializer<std::string>::AllowingExplicit` instead of pairs of overloads for `absl::string_view` and `std::string&&` (the latter as a template to avoid ambiguity). PiperOrigin-RevId: 629405077
- Loading branch information
Showing
32 changed files
with
1,087 additions
and
666 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.