summaryrefslogtreecommitdiff
path: root/init/interface_utils.cpp
diff options
context:
space:
mode:
authorVic Yang <victoryang@google.com>2019-08-06 12:58:44 -0700
committerVic Yang <victoryang@google.com>2019-08-09 11:01:37 -0700
commitd4cb4894348818b90457d94580ed4d611c5d11b0 (patch)
tree04c04ac544f15721ce76c203f927eb0a48976adf /init/interface_utils.cpp
parent23a87716b57114e9b4f607042e3ec1af90d68c0a (diff)
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
Diffstat (limited to 'init/interface_utils.cpp')
0 files changed, 0 insertions, 0 deletions