-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This will allow it to be visible to DanglingPointerDetector, instead of hiding the dangling pointer when moving from raw_ref to SafeRef. This moves the pointer back out of WeakPtrBase so that SafeRef can hold a raw_ptr<T> and WeakPtr can hold a T*. The latter is done to avoid holding memory in quarantine for a dangling WeakPtr - since WeakPtr guarantees no access to that memory beyond its lifetime already. At this point WeakPtrBase is not providing anything of use, so we remove it entirely and put the WeakReference in WeakPtr and SafeRef. To avoid binary size growth, we out-of-line more stuff in WeakReference. With that, binary size decreases another 4k with the change. The SafeRef and WeakPtr tests are improved to actually fail in the case of virtual inheritance if the pointer held in WeakPtr is casted incorrectly to the wrong base class. This won't be an issue with the current implementation, but they were not testing the old uintptr_t implementation correctly. Bug: 1414420 Change-Id: I869cb04cf3711fab892c2223ab4e4cfc5f5f4fbe Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4245786 Reviewed-by: Daniel Cheng <dcheng@chromium.org> Commit-Queue: danakj <danakj@chromium.org> Cr-Commit-Position: refs/heads/main@{#1108684}
- Loading branch information
Showing
5 changed files
with
217 additions
and
122 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.