This repository has been archived by the owner on Nov 8, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add comment that SharedBuffer is deprecated. Both aref and SharedBuffer had memory ordering bugs. Aref has no clients. SharedBuffer had several bugs, which are fixed here: mRefs was declared neither volatile, not atomic, allowing the compiler to, for example, reuse a stale previously loaded value. It used the default android_atomic release memory ordering, which is insufficient for reference count decrements. It used an ordinary memory read in onlyOwner() to check whether an object is safe to deallocate, without any attempt to ensure memory ordering. Comments claimed that SharedBuffer was exactly 16 bytes, but this was neither checked, nor correct on 64-bit platforms. This turns mRef into a std::atomic and removes the android_atomic dependency. Bug: 28826227 Change-Id: I39fa0b4f70ac0471b14ad274806fc4e0c0802e78
- Loading branch information
Showing
3 changed files
with
24 additions
and
72 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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