android_system_core/libutils/include/utils
Vic Yang d4cb489434 libutils: Introduce StaticString16
This is a backward compatible implementation of compile time
constructed String16 support.

As much as we'd like a regular constexpr constructor for String16, we
want to make sure the regular non-static String16 does not regress.
We also need to make sure prebuilts built with previous version of
String16 still works with new libutils.  This means we cannot change
the size of String16 objects and we cannot make anything virtual.

To add a flag to indicate whether a String16 is static without
increasing the size of non-static String16 objects, we repurpose a
reserved field in SharedBuffer as "for client use".  With this, we can
tag every String16 and perform memory operation differently based on
how the underlying buffers are allocated.

By using StaticString16, we are able to eliminate the runtime
construction of a String16 and move it out of .bss section.

Bug: 138856262
Test: Run newly added unit tests.
Change-Id: I72bb8dc27a59b9ef34e0d934bc1e00b0f675855a
2019-08-09 11:01:37 -07:00
..
AndroidThreads.h Modernize codebase by replacing NULL with nullptr 2018-07-13 15:28:59 -07:00
Atomic.h Usage suggestions. 2017-12-19 01:16:00 +00:00
BitSet.h Usage suggestions. 2017-12-19 01:16:00 +00:00
ByteOrder.h
CallStack.h CallStack: include prefix/tag when unlinked 2019-01-03 10:17:07 -08:00
Compat.h libziparchive: fix mac os breakage 2017-03-23 12:02:09 -07:00
Condition.h [libutils] Modernize codebase by replacing NULL with nullptr 2018-07-16 18:11:34 -07:00
Debug.h Remove more semicolons at the end of namespaces 2018-04-11 23:14:13 -07:00
Endian.h
Errors.h "utils/Errors.h": include <stdint.h> for int32_t. 2018-10-16 13:17:15 -07:00
FastStrcmp.h logd: ASAN cleansing 2017-03-27 13:32:57 -07:00
FileMap.h Add noexcept to move constructors and assignment operators. 2018-10-05 16:43:47 +00:00
Flattenable.h Move system/core/ off NO_ERROR. 2018-10-08 11:15:52 -07:00
Functor.h Move system/core/ off NO_ERROR. 2018-10-08 11:15:52 -07:00
JenkinsHash.h
KeyedVector.h Remove more semicolons at the end of namespaces 2018-04-11 23:14:13 -07:00
LightRefBase.h libutils: RefBase remove 'basetype' typedefs 2019-07-16 21:06:28 +00:00
List.h Remove more semicolons at the end of namespaces 2018-04-11 23:14:13 -07:00
Log.h Remove ALOGD_IF_SLOW 2017-07-14 19:51:57 +00:00
Looper.h libutils: switch Looper's fds to unique_fd. 2018-07-18 18:12:12 -07:00
LruCache.h [libutils] Modernize codebase by replacing NULL with nullptr 2018-07-16 18:11:34 -07:00
misc.h Remove extra semicolon at end of namespace 2018-04-10 22:10:54 +00:00
Mutex.h libutils: Fix thread safety annotations in Mutex 2019-03-29 12:21:57 -07:00
NativeHandle.h clean-up libutils includes 2017-03-03 14:47:47 -08:00
Printer.h [libutils] Modernize codebase by replacing NULL with nullptr 2018-07-16 18:11:34 -07:00
ProcessCallStack.h [libutils] Modernize codebase by replacing NULL with nullptr 2018-07-16 18:11:34 -07:00
PropertyMap.h
RefBase.h libutils: RefBase remove 'basetype' typedefs 2019-07-16 21:06:28 +00:00
RWLock.h Modernize codebase by replacing NULL with nullptr 2018-07-13 15:28:59 -07:00
Singleton.h Modernize codebase by replacing NULL with nullptr 2018-07-13 15:28:59 -07:00
SortedVector.h Remove more semicolons at the end of namespaces 2018-04-11 23:14:13 -07:00
StopWatch.h Remove more semicolons at the end of namespaces 2018-04-11 23:14:13 -07:00
String8.h Remove utf32 functions. 2019-07-02 18:15:03 -07:00
String16.h libutils: Introduce StaticString16 2019-08-09 11:01:37 -07:00
StrongPointer.h Revert "Revert "Fix wp and sp comparison bugs"" 2019-03-13 13:26:35 -07:00
SystemClock.h Remove more semicolons at the end of namespaces 2018-04-11 23:14:13 -07:00
Thread.h Suppress lint warnings on google-default-arguments 2018-10-29 23:06:23 +09:00
ThreadDefs.h Remove more semicolons at the end of namespaces 2018-04-11 23:14:13 -07:00
threads.h
Timers.h
Tokenizer.h Move system/core/ off NO_ERROR. 2018-10-08 11:15:52 -07:00
Trace.h Remove more semicolons at the end of namespaces 2018-04-11 23:14:13 -07:00
TypeHelpers.h Remove extra semicolon at end of namespace 2018-04-10 22:10:54 +00:00
Unicode.h Remove two more unused utf32 functions. 2019-07-16 07:56:23 -07:00
Vector.h Remove more semicolons at the end of namespaces 2018-04-11 23:14:13 -07:00
VectorImpl.h Modernize codebase by replacing NULL with nullptr 2018-07-13 15:28:59 -07:00