android_system_core/include/cutils
Hans Boehm 3e4c076ef2 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
2016-05-23 17:28:52 +00:00
..
android_reboot.h Use fsck.f2fs -a instead of -f for faster boot 2015-07-15 10:13:51 -07:00
ashmem.h Don't expose ashmem constants on the host. 2016-05-13 14:47:30 -07:00
atomic.h Second attempt to "Rewrite atomic.h to use stdatomic.h." 2014-11-13 15:59:10 -08:00
bitops.h include: cleanup for -Wsystem-header 2014-05-23 15:09:57 -07:00
compiler.h Add ANDROID_API macro to export symbols 2011-10-12 13:45:59 -07:00
config_utils.h Config utils improvement 2011-05-26 13:57:03 -07:00
debugger.h Move 32 bit/64 bit check into debuggerd. 2015-01-20 17:22:07 -08:00
fs.h include: cleanup for -Wsystem-header 2014-05-23 15:09:57 -07:00
hashmap.h
iosched_policy.h system: Add support for getting/setting i/o priorities and include a userspace tool 2010-02-25 14:02:55 -08:00
jstring.h Do not typedef char16_t if it is a keyword. 2014-07-18 17:53:02 -07:00
klog.h Log more timing information from init. 2015-03-28 00:25:22 -07:00
list.h Merge "Fix list_for_each_safe macro" 2014-05-22 22:27:14 +00:00
log.h Move liblog headers to system/core/include/log 2013-07-24 12:32:39 -07:00
memory.h Be more intention-revealing with libcutils' strlcpy. 2015-04-02 15:39:33 -07:00
misc.h Remove dead code that looked like part of debuggerd. 2014-01-31 10:37:18 -08:00
multiuser.h File-system utilities for installd and zygote. 2012-08-30 10:29:41 -07:00
native_handle.h native_handle.h: fix declaration 2011-05-02 17:27:37 -07:00
open_memstream.h Only the Mac doesn't have open_memstream. 2014-08-20 16:16:24 -07:00
partition_utils.h Remove a declaration for an unimplemented function. 2015-04-20 20:55:43 -07:00
process_name.h
properties.h Remove HAVE_LIBC_SYSTEM_PROPERTIES and HAVE_SYSTEM_PROPERTY_SERVER. 2015-01-12 13:56:34 -08:00
qtaguid.h libcutils: qtaguid: Support new functions, add tag resource tracking. 2011-09-14 15:00:40 -07:00
record_stream.h HACK: cutils: restore record_stream temporarily 2013-06-04 17:40:28 +00:00
sched_policy.h add cpuset support to libcutils 2015-06-11 18:35:46 -07:00
sockets.h libcutils/fastboot: improve multi-buffer write. 2016-02-03 10:01:38 -08:00
str_parms.h Move all libcutils tests into the gtests. 2015-04-02 14:25:55 -07:00
threads.h Fix gettid() on Windows. 2015-05-13 13:43:32 -07:00
trace.h cutils: trace: add DATABASE tag 2015-11-23 12:39:24 -08:00
uevent.h Extend to receive NFLOG packets. 2015-01-15 12:50:59 -08:00