Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cec1439d authored by Matthew Sedam's avatar Matthew Sedam
Browse files

Support pw::Allocator in RefBase and sp

This will allow for custom allocators to be used by
types implementing RefBase and using sp when the
ANDROID_UTILS_USE_PW_ALLOCATOR flag is specified.

If the allocator is not set, we will use standard
new/delete as we do not control where the memory is
allocated. A user may not use sp to allocate the
memory, so we must use default new/delete. If the
user sets the global allocator, they are expected
to use it to allocate all objects if not using sp.

We explicitly disallow allocating arrays of types
using these constructs. Instead, we provide a simple
buffer allocation macro. This reduces the number of
combinations we need to support.

Bug: 416545855
Flag: EXEMPT bugfix
Test: atest libutils_binder_test
Change-Id: I1d1a81dc345d88c94b2ca70c0b04fc32d9f04647
parent 97581510
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment