platform_system_core/include
Hans Boehm 54828dc739 Fix SharedBuffer. Remove aref.
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
(cherry picked from commit 3e4c076ef2)
2016-05-23 15:19:53 -07:00
..
android log: Fix warning with __USE_MINGW_ANSI_STDIO 2014-06-12 13:19:51 -07:00
backtrace Add error reporting mechanism for failing Unwind. 2016-03-10 14:14:43 -08:00
binderwrapper libbinderwrapper: Add BinderWrapper::GetOrCreateInstance() 2016-01-04 12:56:27 -08:00
cutils Fix SharedBuffer. Remove aref. 2016-05-23 15:19:53 -07:00
diskconfig diskconfig: Add missing include for loff_t 2012-07-23 16:11:59 -07:00
log liblog: add android_log_write_string8_len 2016-02-25 15:53:00 -08:00
memtrack Fix typos in comments 2015-04-20 10:10:33 -07:00
mincrypt Add support for ECDSA P-256 with SHA256 2013-10-09 17:04:50 -07:00
nativebridge LibNativeBridge: Version 2 2015-05-31 16:58:24 -07:00
netutils Remove a dead header (<netutils/dhcp.h>). 2016-05-18 14:22:15 -07:00
private Move canned_fs_config into libcutils 2016-04-07 22:44:00 -07:00
system graphics.h: Add android_hdr_t 2016-04-06 14:52:10 -07:00
sysutils Revert "Sigh, more vendors linking against hidden APIs." 2015-03-20 23:51:36 +00:00
usbhost libusbhost: add usb_device_reset 2016-01-13 16:01:42 -08:00
utils Fix memory order and race bugs in Refbase.h & RefBase.cpp 2016-05-19 16:18:26 -07:00
ziparchive libziparchive: ensure ReadAtOffset is atomic 2016-03-09 17:17:19 -08:00